diff options
author | 2002-04-24 17:28:23 +0000 | |
---|---|---|
committer | 2002-04-24 17:28:23 +0000 | |
commit | 8e562a37da72f38d99d7146010601f6c1414bffd (patch) | |
tree | 39891ea7953550b7a6bab2f4b8400367899d75a4 /libmpdemux | |
parent | 8858781943c0bcaf0c7824f4f7cafafd4c02b8a2 (diff) |
Uninit added
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5813 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_audio.c | 8 | ||||
-rw-r--r-- | libmpdemux/demux_demuxers.c | 21 | ||||
-rw-r--r-- | libmpdemux/demux_ogg.c | 18 | ||||
-rw-r--r-- | libmpdemux/demuxer.c | 9 |
4 files changed, 56 insertions, 0 deletions
diff --git a/libmpdemux/demux_audio.c b/libmpdemux/demux_audio.c index b14c012be6..442df9f915 100644 --- a/libmpdemux/demux_audio.c +++ b/libmpdemux/demux_audio.c @@ -317,6 +317,14 @@ void demux_audio_seek(demuxer_t *demuxer,float rel_seek_secs,int flags){ } +void demux_close_audio(demuxer_t* demuxer) { + da_priv_t* priv = demuxer->priv; + + if(!priv) + return; + free(priv); +} + /****************** Options stuff ******************/ #include "../cfgparser.h" diff --git a/libmpdemux/demux_demuxers.c b/libmpdemux/demux_demuxers.c index 90118f802e..7431b42723 100644 --- a/libmpdemux/demux_demuxers.c +++ b/libmpdemux/demux_demuxers.c @@ -81,3 +81,24 @@ void demux_demuxers_seek(demuxer_t *demuxer,float rel_seek_secs,int flags) { 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); +} + diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c index 5db8f6a40b..85eb9f1af8 100644 --- a/libmpdemux/demux_ogg.c +++ b/libmpdemux/demux_ogg.c @@ -27,6 +27,10 @@ demuxer_t* init_avi_with_ogg(demuxer_t* demuxer) { demuxer->audio->id = -2; return demuxer; } + +void demux_close_ogg(demuxer_t* demuxer) { + +} #else #include <ogg/ogg.h> @@ -695,6 +699,7 @@ demuxer_t* init_avi_with_ogg(demuxer_t* demuxer) { 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); @@ -870,4 +875,17 @@ void demux_ogg_seek(demuxer_t *demuxer,float rel_seek_secs,int flags) { } +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 diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index e12d2af415..614d1f129e 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -146,6 +146,9 @@ extern void demux_close_film(demuxer_t* demuxer); 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 @@ void free_demuxer(demuxer_t *demuxer){ 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++){ |