aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/hwcontext.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2017-06-26 20:28:07 +0100
committerMark Thompson <sw@jkqxz.net>2017-11-22 23:20:32 +0000
commit0f93cef2d6405f07b42719506cbde30f07dd8702 (patch)
tree830e0a1a97503bd2ebe9f0658f2c473f5ea79201 /libavutil/hwcontext.c
parent5514bab37a26f36753b756a2f0ceb837d055850f (diff)
downloadffmpeg-0f93cef2d6405f07b42719506cbde30f07dd8702.tar.gz
hwcontext: Perform usual uninitialisation on derived frames contexts
Diffstat (limited to 'libavutil/hwcontext.c')
-rw-r--r--libavutil/hwcontext.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index b26e68fe77..f47158f811 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -217,19 +217,16 @@ static void hwframe_ctx_free(void *opaque, uint8_t *data)
{
AVHWFramesContext *ctx = (AVHWFramesContext*)data;
- if (ctx->internal->source_frames) {
- av_buffer_unref(&ctx->internal->source_frames);
+ if (ctx->internal->pool_internal)
+ av_buffer_pool_uninit(&ctx->internal->pool_internal);
- } else {
- if (ctx->internal->pool_internal)
- av_buffer_pool_uninit(&ctx->internal->pool_internal);
+ if (ctx->internal->hw_type->frames_uninit)
+ ctx->internal->hw_type->frames_uninit(ctx);
- if (ctx->internal->hw_type->frames_uninit)
- ctx->internal->hw_type->frames_uninit(ctx);
+ if (ctx->free)
+ ctx->free(ctx);
- if (ctx->free)
- ctx->free(ctx);
- }
+ av_buffer_unref(&ctx->internal->source_frames);
av_buffer_unref(&ctx->device_ref);