[MPlayer-cvslog] CVS: main/libmpdemux demuxer.c, 1.190, 1.191 demux_mov.c, 1.121, 1.122

Reimar Döffinger CVS syncmail at mplayerhq.hu
Mon Jun 20 16:17:01 CEST 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv28638

Modified Files:
	demuxer.c demux_mov.c 
Log Message:
fix memleak when playing mov files


Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.190
retrieving revision 1.191
diff -u -r1.190 -r1.191
--- demuxer.c	13 Jun 2005 20:39:17 -0000	1.190
+++ demuxer.c	20 Jun 2005 14:16:59 -0000	1.191
@@ -161,6 +161,7 @@
 #ifdef USE_WIN32DLL
 extern void demux_close_avs(demuxer_t* demuxer);
 #endif
+extern void demux_close_mov(demuxer_t* demuxer);
 
 
 #ifdef USE_TV
@@ -258,6 +259,8 @@
     case DEMUXER_TYPE_AVS:
       demux_close_avs(demuxer); break;
 #endif
+    case DEMUXER_TYPE_MOV:
+      demux_close_mov(demuxer); break;
     }
     // free streams:
     for(i = 0; i < MAX_A_STREAMS; i++)

Index: demux_mov.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mov.c,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -r1.121 -r1.122
--- demux_mov.c	18 May 2005 14:44:56 -0000	1.121
+++ demux_mov.c	20 Jun 2005 14:16:59 -0000	1.122
@@ -500,6 +500,30 @@
     return 0;
 }
 
+void demux_close_mov(demuxer_t *demuxer) {
+  mov_priv_t* priv = demuxer->priv;
+  int i;
+  if (!priv)
+    return;
+  for (i = 0; i < MOV_MAX_TRACKS; i++) {
+    mov_track_t *track = priv->tracks[i];
+    if (track) {
+      free(track->tkdata);
+      free(track->stdata);
+      free(track->stream_header);
+      free(track->samples);
+      free(track->chunks);
+      free(track->chunkmap);
+      free(track->durmap);
+      free(track->keyframes);
+      free(track->editlist);
+      free(track->desc);
+      free(track);
+    }
+  }
+  free(priv);
+}
+
 static void lschunks(demuxer_t* demuxer,int level,off_t endpos,mov_track_t* trak){
     mov_priv_t* priv=demuxer->priv;
 //    printf("lschunks (level=%d,endpos=%x)\n", level, endpos);




More information about the MPlayer-cvslog mailing list