filters uninit

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5738 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-04-20 22:24:19 +00:00
parent 698735d071
commit a06d814fb9
4 changed files with 28 additions and 0 deletions

View File

@ -131,6 +131,7 @@ void uninit_video(sh_video_t *sh_video){
if(!sh_video->inited) return;
mp_msg(MSGT_DECVIDEO,MSGL_V,"uninit video: %d \n",sh_video->codec->driver);
mpvdec->uninit(sh_video);
vf_uninit_filter_chain(sh_video->vfilter);
sh_video->inited=0;
}

View File

@ -97,4 +97,12 @@ static inline mp_image_t* new_mp_image(int w,int h){
return mpi;
}
static inline void free_mp_image(mp_image_t* mpi){
if(!mpi) return;
if(mpi->flags&MP_IMGFLAG_ALLOCATED){
if(mpi->planes[0]) free(mpi->planes[0]);
}
free(mpi);
}
#endif

View File

@ -299,3 +299,19 @@ vf_instance_t* append_filters(vf_instance_t* last){
//============================================================================
void vf_uninit_filter(vf_instance_t* vf){
if(vf->uninit) vf->uninit(vf);
free_mp_image(vf->imgctx.static_images[0]);
free_mp_image(vf->imgctx.static_images[1]);
free_mp_image(vf->imgctx.temp_images[0]);
free_mp_image(vf->imgctx.export_images[0]);
free(vf);
}
void vf_uninit_filter_chain(vf_instance_t* vf){
while(vf){
vf_instance_t* next=vf->next;
vf_uninit_filter(vf);
vf=next;
}
}

View File

@ -74,3 +74,6 @@ void vf_next_put_image(struct vf_instance_s* vf,mp_image_t *mpi);
vf_instance_t* append_filters(vf_instance_t* last);
void vf_uninit_filter(vf_instance_t* vf);
void vf_uninit_filter_chain(vf_instance_t* vf);