/***************************************************************************** * EndAudio: decoder destruction ***************************************************************************** * This function is called when the thread ends after a successful * initialization. *****************************************************************************/ void EndAudioDec( decoder_t *p_dec ) { decoder_sys_t *p_sys = p_dec->p_sys; if( p_sys->p_decoded ) { block_ChainRelease( p_sys->p_decoded ); p_sys->p_decoded = NULL; p_sys->pp_decoded_last = &p_sys->p_decoded; } ffmpeg_CloseCodec( p_dec ); }
/***************************************************************************** * EndVideo: decoder destruction ***************************************************************************** * This function is called when the thread ends after a successful * initialization. *****************************************************************************/ void EndVideoDec( decoder_t *p_dec ) { decoder_sys_t *p_sys = p_dec->p_sys; post_mt( p_sys ); /* do not flush buffers if codec hasn't been opened (theora/vorbis/VC1) */ if( p_sys->p_context->codec ) avcodec_flush_buffers( p_sys->p_context ); wait_mt( p_sys ); ffmpeg_CloseCodec( p_dec ); if( p_sys->p_va ) vlc_va_Delete( p_sys->p_va, p_sys->p_context ); vlc_sem_destroy( &p_sys->sem_mt ); }