[Mplayer-cvslog] CVS: main/libmpcodecs dec_video.c,1.131,1.132 mp_image.h,1.8,1.9 vf.c,1.18,1.19 vf.h,1.8,1.9

Arpi of Ize arpi at mplayerhq.hu
Sun Apr 21 00:24:21 CEST 2002


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv21381

Modified Files:
	dec_video.c mp_image.h vf.c vf.h 
Log Message:
filters uninit

Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_video.c,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -r1.131 -r1.132
--- dec_video.c	15 Apr 2002 22:41:06 -0000	1.131
+++ dec_video.c	20 Apr 2002 22:24:19 -0000	1.132
@@ -131,6 +131,7 @@
     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;
 }
 

Index: mp_image.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/mp_image.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- mp_image.h	16 Mar 2002 20:35:59 -0000	1.8
+++ mp_image.h	20 Apr 2002 22:24:19 -0000	1.9
@@ -97,4 +97,12 @@
     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

Index: vf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- vf.c	19 Apr 2002 02:18:46 -0000	1.18
+++ vf.c	20 Apr 2002 22:24:19 -0000	1.19
@@ -299,3 +299,19 @@
 
 //============================================================================
 
+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;
+    }
+}

Index: vf.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- vf.h	17 Apr 2002 19:05:14 -0000	1.8
+++ vf.h	20 Apr 2002 22:24:19 -0000	1.9
@@ -74,3 +74,6 @@
 
 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);
+




More information about the MPlayer-cvslog mailing list