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

avcodec: expand context deletion code

parent 4d212b6f
......@@ -197,7 +197,12 @@ static block_t *vlc_av_frame_Wrap(AVFrame *frame)
*****************************************************************************/
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 );
}
/*****************************************************************************
......
......@@ -349,11 +349,6 @@ static void CloseDecoder( vlc_object_t *p_this )
default:
vlc_assert_unreachable();
}
decoder_sys_t *p_sys = p_dec->p_sys;
avcodec_free_context( &p_sys->p_context );
free( p_sys );
}
/*****************************************************************************
......
......@@ -120,7 +120,12 @@ int InitSubtitleDec(decoder_t *dec, AVCodecContext *context,
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);
}
/**
......
......@@ -1225,6 +1225,8 @@ void EndVideoDec( decoder_t *p_dec )
vlc_va_Delete( p_sys->p_va, ctx->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