From patchwork Sat Oct 23 08:12:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 31217 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp2667007ioa; Sat, 23 Oct 2021 01:14:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxnHMraCYd+Ie9h3cICpZxnaDLy+MhswpEo8QLd9ixnuaVfQf09L9W6T+cLbPNy3qe+tVN X-Received: by 2002:a50:d4cd:: with SMTP id e13mr6922022edj.29.1634976859961; Sat, 23 Oct 2021 01:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634976859; cv=none; d=google.com; s=arc-20160816; b=Q5xRYW9PQmV0wrc+QkMgWHm4bGQOdx733EsPJZm3ADVsj/4JpzLLHjNaz2t42871Ru wT0cwhd5rSwB4CaFyN+dpp39myscTIR7u6gdeoh6nhPllLBgmOY3Z32+0gz3LfLLSw76 ruUQ2Q4JTdy2Y32iHnHvKghFJF1Da7fkcR3FFBWNqGPqm5dhvzlJNsclody3Ky8ES0Ph 2NyCmXigdsPBX88we8Nsnr/N1AfCsj3RI7lwgYeye/vV6wedoQ7s+ZnZCc7rRT0ieaKQ I89ghmzFYEgAxL3hO6Nj1818rH1GyP5KVxHIV9doSbzqoC+Q0zzWju9oF6s7mjVY56q2 R/kg== 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; bh=NOUKXF/liEY/usWH37Or0HPQXhluCqN4OzVTeE5bPrs=; b=sEKa1/uPgoyDwB0HzMhguGcR0cnQROvDekxC2pdvH7o46z1j9tezY3GLyStNjVUVyW asgCZCskDoFFn60L5m8LmH4m9c83VZPpliHDQGzyQsDCvu0DcX54yc7Rq/krte7sq1xw L+1NALf7tdOhEKPz0jSkI+UtJCYnMuWh54pcPqbovZ5oKFLqwgJ84zus8m0TFLVkimtF GIwzCwSMiQzriVxlF9J0AcS2ykiLmi+dlrpuDvmceQBGfFDZCfXX8cwaAtr+49LYgMSe izjO3bwQA2qv+OpbmnX8ss4OngRUnvvcQrrDb6WnIkcFzmq9/p8+AVh2j6PKVqNSsAw2 Iq5w== 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id nd29si20688924ejc.75.2021.10.23.01.14.19; Sat, 23 Oct 2021 01:14:19 -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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 105E568A67D; Sat, 23 Oct 2021 11:14:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe02-3.mx.upcmail.net (vie01a-dmta-pe02-3.mx.upcmail.net [62.179.121.159]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D80686802C1 for ; Sat, 23 Oct 2021 11:13:58 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1meCAA-00HN5s-0D for ffmpeg-devel@ffmpeg.org; Sat, 23 Oct 2021 10:13:58 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id eC9CmEzQxSgGFeC9CmChOu; Sat, 23 Oct 2021 10:12:58 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=f8Q2+96M c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=u66s8vr3bKmF7SZN3awA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 23 Oct 2021 10:12:56 +0200 Message-Id: <20211023081257.28248-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4wfPMylIe3bsWEMMl6inQsR0LJkJyWZAcv6oFRhO+gz8S3nxsYNmsznjT3cwffkWrQjs2YMxCeCbkN8wE6yZUg+r9+RqkzMQjhK57vu4SC8Vk5H+oRycGF Q1/tQKmOJlGooO24vz30XkelAu05kNGhXKOJHZ2Tkfz639QC0aHp2GTN Subject: [FFmpeg-devel] [PATCH 1/2] swscale/utils: Improve return codes of sws_setColorspaceDetails() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: Z3QPqgbekePY Signed-off-by: Michael Niedermayer --- libswscale/utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libswscale/utils.c b/libswscale/utils.c index 3752c3ec38c..c726922527b 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -995,7 +995,10 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], 0, 1 << 16, 1 << 16); return 0; } - return -1; + //We do not support this combination currently, we need to cascade more contexts to compensate + if (c->cascaded_context[0] && memcmp(c->dstColorspaceTable, c->srcColorspaceTable, sizeof(int) * 4)) + return -1; //AVERROR_PATCHWELCOME; + return 0; } if (!isYUV(c->dstFormat) && !isGray(c->dstFormat)) {