From patchwork Tue Nov 14 19:47:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 6067 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp3722377jah; Tue, 14 Nov 2017 11:49:45 -0800 (PST) X-Google-Smtp-Source: AGs4zMYZiBxbHJS/6WSCxvxWyR+QxxouJEUQltnZ/yoLvvI/8xzDyyuxI/8jtADRcXD/std9RxrZ X-Received: by 10.28.37.195 with SMTP id l186mr10569944wml.144.1510688985560; Tue, 14 Nov 2017 11:49:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510688985; cv=none; d=google.com; s=arc-20160816; b=KBwZ1Ck4WWrDOw8Mj8z9p6kNZWBtTMRfvgccWD1xgUvL4RzmB/1zhJ9pWKtaq4tjj3 IN0JObBMvQAFKE5JQnJECktXgu4Ui7ad3Kq2I95aghiWpg6bBAqYucnIMqneKwP1nCEi 8zN6YcchtlV6tzDpHoq/WN/Oap7zdw1plruhGGSRAOxOa+iGV08K7OmO7aP/ZoidOrsc cy2dt4/19u6VAKuEWq50Tl8zwKdi63NdGklBieI2wz+Lp6yhX1GEUESklLK6BV2HfMd8 ojHaDiscX0vxYSlDJ1X/UDJfp4VVSCCm+wOQ5w9g4rIBTwqMEAD+6osW9Lfd3SIJrPA/ 9yUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=3i8OmVMbFFKFg0SrimAl6zQQ14P+jCG67ESksnFGo9A=; b=hkET8Q95oB9BxJfPpFXwPPuMdcP/foAHm5j9vpglo03HnccQxYV/Kc92yrP4+BwfIq 19f2c8HXLursYMSyiWWFNLQez+MHmMgNwLEaKt+n5QHtkALuD1TSuH1CAlMPtjNkI2cm iDNvi3yGIx7YlfC8tNUBLU28cmD+4NYhgzNg+6vGm0WF9ZrhB5vI3ZzpR/zCGhwsW4KR YneEFf+MFe0WoqAYTlh9iCt4QjqfEnySzJqY+VYCdGKbw8OmaGrTR4A8fIBMGAVWjIE3 hxhKNcdwxlvi/syFYnC6t5AqgXbbcipccn9lOxbWnpKawT9a28VZftQUK9Dji99xMeSt Y9NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=1G657HHm; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 22si16872311wrb.207.2017.11.14.11.49.45; Tue, 14 Nov 2017 11:49:45 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=1G657HHm; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3501968A1D4; Tue, 14 Nov 2017 21:47:38 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B75CB68A151 for ; Tue, 14 Nov 2017 21:47:33 +0200 (EET) Received: by mail-wm0-f68.google.com with SMTP id b189so16947560wmd.5 for ; Tue, 14 Nov 2017 11:47:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=Yxnf4uL8rZGcS9VkEWkoSg8K0NVot+rAddpj6icgYjA=; b=1G657HHmRbZmZtbd5V97cAHma60hyXQe8yz3wymQE+9fijB2cU9m3XeFIINj0rQHCp C5HIj6WpsidAguffNzqPd+t1PiPanmQIXBkQ7n3++Ki5uuB5RvglRspuZ2yryWKpI7Q2 Rzy1YdnVrXyHi5Gny6aXxqIiJepIbGQDDuRR9WHVgULQzWMxNs+SEA+Jdm1Poo7Go/Bx mLv0qlpm+qh2hzZTprvMFKrCSR+CK/l8BWDYdZn7vYW8Sozal/CVmJBkxVsDIrWVXhi1 bWYkbsqLn9XsYPCVZi/DOW63cJjsdhUc03Bmm75xBnWBe5rmSZhVqu+r5u266Q7KS+oW Wl9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Yxnf4uL8rZGcS9VkEWkoSg8K0NVot+rAddpj6icgYjA=; b=UFDjW1xPz66h31LUaPGTAvUB52sFAKuWvw0aFwqsb2JenONNg6PxXQdqPyjM1TFFmI Wg/ghQCAN5EZuMmrRkNl0RYN/V2i3Mp2IRAK65MQZSHdGY4gsKvMsfoyGkHrdM0Ep4U8 50gxtKHV9CMAQ0PToEA/T4mtRXD792h3zdsKjAmUJhfSOhw2J1HtFpMthxDr8Fmct0wu m6Z9uxYlaUljF0R0HLD4I2qaNFA7lyM9tirmYxmeLvj9tzbeCdCZ2iIXEj4JbUbJ17g5 lX0kN8cpYeXhaG+VPLw2q4i5BrdKVX7XUdUsZ+HbNp/Zj6IIPkYdwoH9aJEe1vvI+O3d oHug== X-Gm-Message-State: AJaThX5jd/y0Qp7nQmx/2kp99vp03ZpXvHRIOVRWOmO3X8FD0kDMYehS +RObF9KDCvJuhTCx4zHl+Mxr8Msi X-Received: by 10.28.1.80 with SMTP id 77mr10312469wmb.51.1510688868124; Tue, 14 Nov 2017 11:47:48 -0800 (PST) Received: from rywe.jkqxz.net (cpc91242-cmbg18-2-0-cust650.5-4.cable.virginm.net. [82.8.130.139]) by smtp.gmail.com with ESMTPSA id v35sm38938226wrc.13.2017.11.14.11.47.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Nov 2017 11:47:47 -0800 (PST) From: Mark Thompson To: ffmpeg-devel@ffmpeg.org Date: Tue, 14 Nov 2017 19:47:29 +0000 Message-Id: <20171114194730.11052-15-sw@jkqxz.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171114194730.11052-1-sw@jkqxz.net> References: <20171114194730.11052-1-sw@jkqxz.net> Subject: [FFmpeg-devel] [PATCH 14/15] hwcontext: Perform usual uninitialisation on derived frames contexts X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavutil/hwcontext.c | 17 +++++++---------- 1 file 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);