summaryrefslogtreecommitdiffstats
path: root/libhb/decavcodec.c
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2018-01-12 01:53:01 +0100
committerBradley Sepos <[email protected]>2018-05-28 23:56:19 -0400
commit5a52b9265c71296f676be899f7f8ef893e12f7bb (patch)
tree897c3192ad9bd1ef8d41d6a11a5fedbf03b34886 /libhb/decavcodec.c
parent2d6441de7700303e0ca1896bd0b6db0509ded3d2 (diff)
FFMPEG: Use avcodec_free_context(..) instead of deprecated leaking avcodec_close(..)
Hence rename hb_avcodec_close -> hb_avcodec_free_context and pass the required ptr-ptr. avcodec_free_context(..) ensures releasing of all resources attached to the context.
Diffstat (limited to 'libhb/decavcodec.c')
-rw-r--r--libhb/decavcodec.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c
index f12e20df5..26430dce4 100644
--- a/libhb/decavcodec.c
+++ b/libhb/decavcodec.c
@@ -390,13 +390,12 @@ static void closePrivData( hb_work_private_t ** ppv )
//if (!(pv->qsv.decode && pv->job != NULL && (pv->job->vcodec & HB_VCODEC_QSV_MASK)))
#endif
{
- hb_avcodec_close(pv->context);
+ hb_avcodec_free_context(&pv->context);
}
}
if ( pv->context )
{
- av_freep( &pv->context->extradata );
- av_freep( &pv->context );
+ hb_avcodec_free_context(&pv->context);
}
hb_audio_resample_free(pv->resample);
@@ -821,9 +820,7 @@ static int decavcodecaBSInfo( hb_work_object_t *w, const hb_buffer_t *buf,
if ( parser != NULL )
av_parser_close( parser );
- hb_avcodec_close( context );
- av_freep( &context->extradata );
- av_freep( &context );
+ hb_avcodec_free_context(&context);
return result;
}
@@ -2105,9 +2102,7 @@ static void decavcodecvFlush( hb_work_object_t *w )
if ( pv->title->opaque_priv == NULL )
{
pv->video_codec_opened = 0;
- hb_avcodec_close( pv->context );
- av_freep( &pv->context->extradata );
- av_freep( &pv->context );
+ hb_avcodec_free_context(&pv->context);
if ( pv->parser )
{
av_parser_close(pv->parser);