summaryrefslogtreecommitdiffstats
path: root/libhb/encavcodec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhb/encavcodec.c')
-rw-r--r--libhb/encavcodec.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libhb/encavcodec.c b/libhb/encavcodec.c
index 01a1fc389..8484bba6a 100644
--- a/libhb/encavcodec.c
+++ b/libhb/encavcodec.c
@@ -399,12 +399,13 @@ void encavcodecClose( hb_work_object_t * w )
return;
}
hb_chapter_queue_close(&pv->chapter_queue);
- if( pv->context && pv->context->codec )
+ if( pv->context )
{
hb_deep_log( 2, "encavcodec: closing libavcodec" );
- avcodec_flush_buffers( pv->context );
- hb_avcodec_close( pv->context );
- av_free( pv->context );
+ if( pv->context->codec ) {
+ avcodec_flush_buffers( pv->context );
+ }
+ hb_avcodec_free_context(&pv->context);
}
if( pv->file )
{