Commit 2b8f8d1c authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

avcodec: remove ffmpeg_CloseCodec()

avcodec_free_context() already takes care to close the context if it was
opened.
parent f97ee880
......@@ -200,7 +200,6 @@ void EndAudioDec( decoder_t *p_dec )
decoder_sys_t *sys = p_dec->p_sys;
AVCodecContext *ctx = sys->p_context;
ffmpeg_CloseCodec( p_dec );
avcodec_free_context( &ctx );
free( sys );
}
......
......@@ -385,16 +385,3 @@ int ffmpeg_OpenCodec( decoder_t *p_dec )
msg_Dbg( p_dec, "codec (%s) started", p_sys->p_codec->name );
return VLC_SUCCESS;
}
void ffmpeg_CloseCodec( decoder_t *p_dec )
{
decoder_sys_t *p_sys = p_dec->p_sys;
if( !avcodec_is_open( p_sys->p_context ) )
return;
vlc_avcodec_lock();
avcodec_close( p_sys->p_context );
vlc_avcodec_unlock();
msg_Dbg( p_dec, "ffmpeg codec (%s) stopped", p_sys->p_codec->name );
}
......@@ -48,7 +48,6 @@ void EndSubtitleDec( decoder_t * );
/* Initialize decoder */
int ffmpeg_OpenCodec( decoder_t *p_dec );
void ffmpeg_CloseCodec( decoder_t *p_dec );
/*****************************************************************************
* Module descriptor help strings
......
......@@ -123,7 +123,6 @@ void EndSubtitleDec(decoder_t *dec)
decoder_sys_t *sys = dec->p_sys;
AVCodecContext *ctx = sys->p_context;
ffmpeg_CloseCodec(dec);
avcodec_free_context(&ctx);
free(sys);
}
......
......@@ -1208,6 +1208,7 @@ void EndVideoDec( decoder_t *p_dec )
{
decoder_sys_t *p_sys = p_dec->p_sys;
AVCodecContext *ctx = p_sys->p_context;
void *hwaccel_context;
post_mt( p_sys );
......@@ -1219,13 +1220,13 @@ void EndVideoDec( decoder_t *p_dec )
cc_Flush( &p_sys->cc );
ffmpeg_CloseCodec( p_dec );
hwaccel_context = ctx->hwaccel_context;
avcodec_free_context( &ctx );
if( p_sys->p_va )
vlc_va_Delete( p_sys->p_va, ctx->hwaccel_context );
vlc_va_Delete( p_sys->p_va, hwaccel_context );
vlc_sem_destroy( &p_sys->sem_mt );
avcodec_free_context( &ctx );
free( p_sys );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment