comparison libmpdemux/demuxer.c @ 16291:f443f849531b

Do not free demuxer before using demuxer->desc->type (happened when using -audiofile).
author reimar
date Tue, 23 Aug 2005 08:03:26 +0000
parents 3e8e281ecc86
children fb95057e370e
comparison
equal deleted inserted replaced
16290:8a2585bc494f 16291:f443f849531b
258 mp_msg(MSGT_DEMUXER,MSGL_DBG2,"DEMUXER: freeing demuxer at %p\n",demuxer); 258 mp_msg(MSGT_DEMUXER,MSGL_DBG2,"DEMUXER: freeing demuxer at %p\n",demuxer);
259 if(demuxer->desc->close) 259 if(demuxer->desc->close)
260 demuxer->desc->close(demuxer); 260 demuxer->desc->close(demuxer);
261 // Very ugly hack to make it behave like old implementation 261 // Very ugly hack to make it behave like old implementation
262 if (demuxer->desc->type == DEMUXER_TYPE_DEMUXERS) 262 if (demuxer->desc->type == DEMUXER_TYPE_DEMUXERS)
263 return; 263 goto skip_streamfree;
264 // free streams: 264 // free streams:
265 for(i = 0; i < MAX_A_STREAMS; i++) 265 for(i = 0; i < MAX_A_STREAMS; i++)
266 if(demuxer->a_streams[i]) free_sh_audio(demuxer->a_streams[i]); 266 if(demuxer->a_streams[i]) free_sh_audio(demuxer->a_streams[i]);
267 for(i = 0; i < MAX_V_STREAMS; i++) 267 for(i = 0; i < MAX_V_STREAMS; i++)
268 if(demuxer->v_streams[i]) free_sh_video(demuxer->v_streams[i]); 268 if(demuxer->v_streams[i]) free_sh_video(demuxer->v_streams[i]);
270 //if(sh_video) free_sh_video(sh_video); 270 //if(sh_video) free_sh_video(sh_video);
271 // free demuxers: 271 // free demuxers:
272 free_demuxer_stream(demuxer->audio); 272 free_demuxer_stream(demuxer->audio);
273 free_demuxer_stream(demuxer->video); 273 free_demuxer_stream(demuxer->video);
274 free_demuxer_stream(demuxer->sub); 274 free_demuxer_stream(demuxer->sub);
275 skip_streamfree:
275 if(demuxer->info) { 276 if(demuxer->info) {
276 for(i=0;demuxer->info[i] != NULL; i++) 277 for(i=0;demuxer->info[i] != NULL; i++)
277 free(demuxer->info[i]); 278 free(demuxer->info[i]);
278 free(demuxer->info); 279 free(demuxer->info);
279 } 280 }