1
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 06:03:45 +01:00

Added demuxer uninit

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5811 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
albeu 2002-04-24 15:36:07 +00:00
parent 314ec6091b
commit 2b955d3b05
9 changed files with 101 additions and 1 deletions

View File

@ -109,3 +109,11 @@ demuxer_t* demux_open_bmp(demuxer_t* demuxer)
return demuxer;
}
void demux_close_bmp(demuxer_t* demuxer) {
bmp_image_t *bmp_image = demuxer->priv;
if(!bmp_image)
return;
free(bmp_image);
}

View File

@ -413,3 +413,14 @@ demuxer_t* demux_open_film(demuxer_t* demuxer)
return demuxer;
}
void demux_close_film(demuxer_t* demuxer) {
film_data_t *film_data = demuxer->priv;
if(!film_data)
return;
if(film_data->chunks)
free(film_data->chunks);
free(film_data);
}

View File

@ -153,3 +153,18 @@ demuxer_t* demux_open_fli(demuxer_t* demuxer){
return demuxer;
}
void demux_close_fli(demuxer_t* demuxer) {
fli_frames_t *frames = demuxer->priv;
if(!frames)
return;
if(frames->filepos)
free(frames->filepos);
if(frames->frame_size)
free(frames->frame_size);
free(frames);
}

View File

@ -122,3 +122,11 @@ demuxer_t* demux_open_mf(demuxer_t* demuxer){
return demuxer;
}
void demux_close_mf(demuxer_t* demuxer) {
demuxer_mf_t *dmf = demuxer->priv;
if(!dmf)
return;
free(dmf);
}

View File

@ -302,3 +302,16 @@ int nuv_check_file ( demuxer_t* demuxer )
stream_seek ( demuxer->stream, orig_pos );
return 1;
}
void demux_close_nuv(demuxer_t* demuxer) {
nuv_priv_t* priv = demuxer->priv;
nuv_position_t* pos;
if(!priv)
return;
for(pos = priv->index_list ; pos != NULL ; ) {
nuv_position_t* p = pos;
pos = pos->next;
free(p);
}
free(priv);
}

View File

@ -8,6 +8,9 @@
TODO: fix the whole syncing mechanism
$Log$
Revision 1.10 2002/04/24 15:36:06 albeu
Added demuxer uninit
Revision 1.9 2002/03/15 15:51:37 alex
added PRE-ALPHA seeking ability and index table generator (like avi's one)
@ -510,6 +513,7 @@ void demux_open_real(demuxer_t* demuxer)
{
buf = malloc(len+1);
stream_read(demuxer->stream, buf, len);
buf[len] = 0;
demux_info_add(demuxer, "name", buf);
free(buf);
}

View File

@ -242,3 +242,12 @@ demuxer_t* demux_open_roq(demuxer_t* demuxer)
return demuxer;
}
void demux_close_roq(demuxer_t* demuxer) {
roq_data_t *roq_data = demuxer->priv;
if(!roq_data)
return;
free(roq_data);
}

View File

@ -255,7 +255,9 @@ int demux_seek_y4m(demuxer_t *demuxer, float rel_seek_secs, int flags) {
void demux_close_y4m(demuxer_t *demuxer)
{
y4m_priv_t* priv = demuxer->priv;
if(!priv)
return;
if (!priv->is_older)
y4m_fini_stream_info(((y4m_priv_t*)demuxer->priv)->si);
free(((y4m_priv_t*)demuxer->priv)->si);

View File

@ -137,9 +137,39 @@ void free_sh_video(sh_video_t* sh){
free(sh);
}
extern void demux_close_vivo(demuxer_t *demuxer);
extern void demux_close_real(demuxer_t *demuxer);
extern void demux_close_y4m(demuxer_t *demuxer);
extern void demux_close_mf(demuxer_t* demuxer);
extern void demux_close_roq(demuxer_t* demuxer);
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);
void free_demuxer(demuxer_t *demuxer){
int i;
mp_msg(MSGT_DEMUXER,MSGL_V,"DEMUXER: freeing demuxer at %p \n",demuxer);
switch(demuxer->type) {
case DEMUXER_TYPE_VIVO:
demux_close_vivo(demuxer); break;
case DEMUXER_TYPE_REAL:
demux_close_real(demuxer); break;
case DEMUXER_TYPE_Y4M:
demux_close_y4m(demuxer); break;
case DEMUXER_TYPE_MF:
demux_close_mf(demuxer); break;
case DEMUXER_TYPE_ROQ:
demux_close_roq(demuxer); break;
case DEMUXER_TYPE_FILM:
demux_close_film(demuxer); break;
case DEMUXER_TYPE_BMP:
demux_close_bmp(demuxer); break;
case DEMUXER_TYPE_FLI:
demux_close_fli(demuxer); break;
case DEMUXER_TYPE_NUV:
demux_close_nuv(demuxer); break;
}
// free streams:
for(i=0;i<256;i++){
if(demuxer->a_streams[i]) free_sh_audio(demuxer->a_streams[i]);