From patchwork Wed Aug 2 23:18:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Boorer X-Patchwork-Id: 4607 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.46.211 with SMTP id u202csp131147vsu; Wed, 2 Aug 2017 16:18:12 -0700 (PDT) X-Received: by 10.28.152.136 with SMTP id a130mr5007991wme.177.1501715892392; Wed, 02 Aug 2017 16:18:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501715892; cv=none; d=google.com; s=arc-20160816; b=etrKaFkS5HzHW6M6Ptnn447yeQ6yXMuQ8RSx3ncRxnqD6ey67BsQLRqdUuLbBqry3f SmRFnINyMvqAvcrHEp8FcZ1NbV3qNhwvrccLbbhj2LsQmXiwMA1rv2gDUQM8P5FBj2z+ Pe2cWqkVUq+i9qZ5u3SOYKceuJJp+Cw3YOmgMQMjj0aLCIl8Isc9Kr6bW0KxlzyItnPc akI5StPde0DFoFd4qtLyiRk4qTZ2jeJlFyWK1PX8jnPMrsXfWFO+MGiTbGxX8uj65js+ 7KDppXwcaZwE9dkVlAUB2WV2KAbFkwFUKWAsxyhDA/QHDGP9cYDgHGoE5zxnwY3GI/3R j1Ag== 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:message-id:date:to:from:delivered-to :arc-authentication-results; bh=He8nGCkq5/w9u0SyJtcxKgNbXPqZla2iJ5QW9GrMNXs=; b=dcomUaYjge4svZbT/ii4Qu2mVxrkAw/gs+bpzN8rCw9xEVBQWBEI0M/FUc7Usm3F7o wTzoqARbeKYu0dDOfk6g4L7YQuZne6vUI/ZgUL0NwFmHahw4sWH4cN6v95D7r2MmiT8n Dj3uu9F6GaeSFscLkpGZ5Md1bx72DIPjrQVEuwhpOY6FCJ2NZqnLbROCCSRM26Dp/cAR 3LFwQWz+7QrigwrAKzK2vHNorAd3i1ifaDBIfA5Rn1jVGu8adwSZ6OAdnSkTzD2Z6PLV bzUClUj/lpqHjVm3doTF1nckEmIADr+LXgFmYK0Ga2VObyD18ie6POXnM9z2n3JKSGUA p53Q== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id j2si325965wre.433.2017.08.02.16.18.11; Wed, 02 Aug 2017 16:18:12 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A6E7668995B; Thu, 3 Aug 2017 02:18:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from natter.dneg.com (natter.dneg.com [193.203.82.213]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E1324689753 for ; Thu, 3 Aug 2017 02:17:58 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by natter.dneg.com (Postfix) with ESMTP id 0584619E8078 for ; Thu, 3 Aug 2017 00:18:02 +0100 (BST) X-Virus-Scanned: amavisd-new at mx-dneg Received: from natter.dneg.com ([127.0.0.1]) by localhost (natter.dneg.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qF1fAteuHSXA for ; Thu, 3 Aug 2017 00:18:01 +0100 (BST) Received: from zimbrai.dneg.com (zimbrai.dneg.com [10.21.20.14]) by natter.dneg.com (Postfix) with ESMTP id E71D219E8076 for ; Thu, 3 Aug 2017 00:18:01 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by zimbrai.dneg.com (Postfix) with ESMTP id C479D692DB for ; Thu, 3 Aug 2017 00:18:01 +0100 (BST) Received: from zimbrai.dneg.com ([127.0.0.1]) by localhost (zimbrai.dneg.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ZyrAhKvISc18 for ; Thu, 3 Aug 2017 00:18:01 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by zimbrai.dneg.com (Postfix) with ESMTP id AB791692E0 for ; Thu, 3 Aug 2017 00:18:01 +0100 (BST) X-Virus-Scanned: amavisd-new at zimbra-dneg Received: from zimbrai.dneg.com ([127.0.0.1]) by localhost (zimbrai.dneg.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id AdflMacTQlAd for ; Thu, 3 Aug 2017 00:18:01 +0100 (BST) Received: from edale.dneg.com (edale.dhcp.dneg.com [10.21.40.176]) by zimbrai.dneg.com (Postfix) with ESMTP id 9730D692DB for ; Thu, 3 Aug 2017 00:18:01 +0100 (BST) Received: by edale.dneg.com (Postfix, from userid 4139) id 72B4710E299; Thu, 3 Aug 2017 00:18:01 +0100 (BST) From: Mark Boorer To: ffmpeg-devel@ffmpeg.org Date: Thu, 3 Aug 2017 00:18:01 +0100 Message-Id: <20170802231801.24126-1-markboo99@gmail.com> X-Mailer: git-send-email 2.9.3 Subject: [FFmpeg-devel] [PATCH] swscale/utils.c: Fix incorrect error when calling sws_setColorspaceDetails 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" Fixes: When converting yuv -> yuv and changing any of srcRange, dstRange, brightness, contrast, or saturation the context would not be re-initialized as required. --- libswscale/utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libswscale/utils.c b/libswscale/utils.c index 17c9967..9071d3a 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -959,6 +959,9 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], srcRange, table, dstRange, 0, 1 << 16, 1 << 16); return 0; + } else if (!c->cascaded_context[0] && c->srcW && c->srcH && c->dstW && c->dstH) { + int ret = sws_init_context(c, NULL, NULL); + return ret; } return -1; }