Browse Source

hwcontext: Perform usual uninitialisation on derived frames contexts

tags/n4.0
Mark Thompson 8 years ago
parent
commit
0f93cef2d6
1 changed files with 7 additions and 10 deletions
  1. +7
    -10
      libavutil/hwcontext.c

+ 7
- 10
libavutil/hwcontext.c View File

@@ -217,19 +217,16 @@ static void hwframe_ctx_free(void *opaque, uint8_t *data)
{ {
AVHWFramesContext *ctx = (AVHWFramesContext*)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); av_buffer_unref(&ctx->device_ref);




Loading…
Cancel
Save