[Mplayer-cvslog] CVS: main/libmpdemux demux_audio.c,1.7,1.8 demux_demuxers.c,1.1,1.2 demux_ogg.c,1.6,1.7 demuxer.c,1.94,1.95

Alban Bedel CVS albeu at mplayerhq.hu
Wed Apr 24 19:28:37 CEST 2002


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

Modified Files:
	demux_audio.c demux_demuxers.c demux_ogg.c demuxer.c 
Log Message:
Uninit added


Index: demux_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_audio.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- demux_audio.c	23 Apr 2002 13:27:46 -0000	1.7
+++ demux_audio.c	24 Apr 2002 17:28:23 -0000	1.8
@@ -317,6 +317,14 @@
 
 }
 
+void demux_close_audio(demuxer_t* demuxer) {
+  da_priv_t* priv = demuxer->priv;
+
+  if(!priv)
+    return;
+  free(priv);
+}
+
 /****************** Options stuff ******************/
 
 #include "../cfgparser.h"

Index: demux_demuxers.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_demuxers.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- demux_demuxers.c	20 Feb 2002 16:59:25 -0000	1.1
+++ demux_demuxers.c	24 Apr 2002 17:28:23 -0000	1.2
@@ -81,3 +81,24 @@
       demux_seek(priv->sd,pos,1);
 
 }
+
+void demux_close_demuxers(demuxer_t* demuxer) {
+  int i;
+  dd_priv_t* priv = demuxer->priv;
+
+  if(priv->vd)
+    free_demuxer(priv->vd);
+  if(priv->ad && priv->ad != priv->vd)
+    free_demuxer(priv->ad);
+  if(priv->sd && priv->sd != priv->vd && priv->sd != priv->ad)
+    free_demuxer(priv->sd);
+
+  free(priv);
+  if(demuxer->info) {
+    for(i=0;demuxer->info[i] != NULL; i++)
+      free(demuxer->info[i]);
+    free(demuxer->info);
+  }
+  free(demuxer);
+}
+  

Index: demux_ogg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_ogg.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- demux_ogg.c	24 Apr 2002 12:28:03 -0000	1.6
+++ demux_ogg.c	24 Apr 2002 17:28:23 -0000	1.7
@@ -27,6 +27,10 @@
   demuxer->audio->id = -2;
   return demuxer;
 }
+
+void demux_close_ogg(demuxer_t* demuxer) {
+
+}
 #else
 
 #include <ogg/ogg.h>
@@ -695,6 +699,7 @@
   ogg_d = (ogg_demuxer_t*)calloc(1,sizeof(ogg_demuxer_t));
   ogg_d->num_sub = 1;
   ogg_d->subs = (ogg_stream_t*)malloc(sizeof(ogg_stream_t));
+  ogg_d->subs[0].vorbis = 1;
 
    // Init the ogg physical stream
   ogg_sync_init(&ogg_d->sync);
@@ -868,6 +873,19 @@
 
   mp_msg(MSGT_DEMUX,MSGL_ERR,"Can't find the good packet :(\n");  
 
+}
+
+void demux_close_ogg(demuxer_t* demuxer) {
+  ogg_demuxer_t* ogg_d = demuxer->priv;
+
+  if(!ogg_d)
+    return;
+
+  if(ogg_d->subs)
+    free(ogg_d->subs);
+  if(ogg_d->syncpoints)
+    free(ogg_d->syncpoints);
+  free(ogg_d);
 }
 
 #endif

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -r1.94 -r1.95
--- demuxer.c	24 Apr 2002 15:36:07 -0000	1.94
+++ demuxer.c	24 Apr 2002 17:28:23 -0000	1.95
@@ -146,6 +146,9 @@
 extern void demux_close_bmp(demuxer_t* demuxer);
 extern void demux_close_fli(demuxer_t* demuxer);
 extern void demux_close_nuv(demuxer_t* demuxer);
+extern void demux_close_audio(demuxer_t* demuxer);
+extern void demux_close_ogg(demuxer_t* demuxer);
+extern void demux_close_demuxers(demuxer_t* demuxer);
 
 void free_demuxer(demuxer_t *demuxer){
     int i;
@@ -169,6 +172,12 @@
       demux_close_fli(demuxer); break;
     case DEMUXER_TYPE_NUV:
       demux_close_nuv(demuxer); break;
+    case DEMUXER_TYPE_AUDIO:
+      demux_close_audio(demuxer); break;
+    case DEMUXER_TYPE_OGG:
+      demux_close_ogg(demuxer); break;
+    case DEMUXER_TYPE_DEMUXERS:
+      demux_close_demuxers(demuxer); return;
     }
     // free streams:
     for(i=0;i<256;i++){




More information about the MPlayer-cvslog mailing list