From patchwork Wed Jan 4 16:59:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 39872 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bc95:b0:ad:ade2:bfd2 with SMTP id fx21csp8947301pzb; Wed, 4 Jan 2023 08:54:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXvklhE+uQxLsfGOMLNZtwroHhc1K9QJXq6P0LpyGon8alew+6lRHsiIHuTGiOl77gAiWaB6 X-Received: by 2002:a17:907:8b95:b0:84c:95c7:304b with SMTP id tb21-20020a1709078b9500b0084c95c7304bmr21960999ejc.14.1672851265986; Wed, 04 Jan 2023 08:54:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672851265; cv=none; d=google.com; s=arc-20160816; b=02iG9I3crfIrIgEXgfhN5qnW9n6MJg8QLNVdNFwEYwLYUPgtBudieDwTKMcMb+IAOz kMbitjIh7VxGzEvNm8gJthIuHllUK5REVoPB/RaBIsQnjax6G269FrXyN+vIyT77X0GX puE85mBTztLG5AHfhJYlFDq7aFiytG9YZJ/1ryAswieYdGodlSRfILhvpJwAXRm+jrGk RvPCySGNj598An0VQZ9ShQz/8nrrEDH8VSkWdwPsIozQGyyQlS5MUeBCNgDSkXL2QpDO F1vUH12eR4hB6HXAMwzkg1ntgv7OoZCQ6LM5k33o3DQzvA36Zq5bCiZGnDqGnrqLn48f 1sYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to; bh=Rt1/ymFIcOQxxhIsp12n94SoCRKl2dxqzzNNBwRlWzo=; b=iV4Z/Ep/jvHjgXQF6m/UWhMypeiAod/HabKJsHq1kZSAYJqTuhoVmJxwieRYbseZ+V 8MVWjL61+DBWJQUqx43Jk7KIcfz6cZMlERfBJUMfBPOZ7SED57FIiBYMlgxjILmVDGJn V3pwPdLhkBAFknUUnhUG17tS3FyFKPPlnmaU2q/QDdl7OYdpbchk+glo2DCEiXci5eoP 1cAMm8VSaHTN1gTP/yZKDaEmbZYFEBCjNyjdG9DJ2rvKMvMhjPGIKo8Al6EyjzKqcGPA xIp3hFW92ybDU98dk/9ybqyu1/eGCFxYZSH4pghHbWZoY3zBPk3m8saxm6WPrX35K08O VeKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=U3fI0eRZ; 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=QUARANTINE 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 un2-20020a170907cb8200b007c500a254e3si23966244ejc.941.2023.01.04.08.54.25; Wed, 04 Jan 2023 08:54:25 -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=@gmail.com header.s=20210112 header.b=U3fI0eRZ; 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=QUARANTINE 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 0618468BCCF; Wed, 4 Jan 2023 18:54:23 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-vs1-f43.google.com (mail-vs1-f43.google.com [209.85.217.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9013D68B76F for ; Wed, 4 Jan 2023 18:54:16 +0200 (EET) Received: by mail-vs1-f43.google.com with SMTP id s127so21462611vsb.5 for ; Wed, 04 Jan 2023 08:54:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=xtkr93IcaqiXYWNl9X3fLg2nObsj+/oIo2QIy3Rl4c0=; b=U3fI0eRZI7ZfYxFKciBQJCTocUVw588RUm3e/YHDZgW6uueWO8M2qlRUK52k8Efjeg /CZvDtPIuzZWSyLRNkEeaItxdfQvxwstAWuA4V3FTgE4eJqa3UbW9xYYVmE7ePoeHf0R 26c3alHfgli3GNpVfQ351XiyDUiFeoaYlCINOBnH78rjVo3T3LxzepcBiGJwyk4Q2Up6 2ihu4xofoW2yPBn48Nnebd9HTvFvruti2MTX5F3dBysm5WYi5dgrwMGsVlCPiuVoawco 9B2rMuU2e4MSrBsGaYwrC+XtQTrGNUH5c92jxBzACCNgHi0EQTq/PiWGNqEGvrMose/Q u4xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xtkr93IcaqiXYWNl9X3fLg2nObsj+/oIo2QIy3Rl4c0=; b=i8dbh/Wye+lR4zrrACiFLgpkqAA0Q3O9As+73S7RLmIS1o+TY1pjw9RuDL57gPA4rJ 1SnpGNI7XLy6Y2vB701F0QiDARUz3gh549WiKk3HGj339HRzL4Qcero9LTxzGtZpafhr 2Y5STvh2wF/jK46cnTbxOHmxLZSby8RCl9JhsEvPUsiJvPXUw5+36hRvrfHX8zHZwNV6 wcFsiuC0HOPou0hM2Vw5SsfxEmnr7qk4ZxBxxrjTXRtrIJq74AB4QMXVtDZMkJlAt3E7 u4OMlWi5dPkIuNQCVXX8j4HZXhMUYRSyt2ujjqkIbEc8iXGOLymxby/C5LbBZTMmH9ss mDMg== X-Gm-Message-State: AFqh2krjuotxoesaaItU3ZWU8h5QX1CXRKkSmDH/SQDJ8SiDqr3kA9l/ VzHpaiuxlhrEGUxp+saNko6PxRXmp2CREdVP9IukIlpV X-Received: by 2002:a05:6102:14a9:b0:3cb:b9c:4a24 with SMTP id d41-20020a05610214a900b003cb0b9c4a24mr2706421vsv.57.1672851255243; Wed, 04 Jan 2023 08:54:15 -0800 (PST) MIME-Version: 1.0 From: Paul B Mahol Date: Wed, 4 Jan 2023 17:59:14 +0100 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [FFmpeg-devel] [PATCH] swresample fixes 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: J8XLRWwGsB0n Patches attached. From 0415ed37bee0c2b640920edad87ec927dda95fb5 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Wed, 4 Jan 2023 17:53:01 +0100 Subject: [PATCH 2/3] swresample/swresample_frame: fix regression in detecting changes Do not overwrite return variable values, instead use different one for checking results. Signed-off-by: Paul B Mahol --- libswresample/swresample_frame.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libswresample/swresample_frame.c b/libswresample/swresample_frame.c index 53ac487136..319ce045a1 100644 --- a/libswresample/swresample_frame.c +++ b/libswresample/swresample_frame.c @@ -84,7 +84,7 @@ static int config_changed(SwrContext *s, const AVFrame *out, const AVFrame *in) { AVChannelLayout ch_layout = { 0 }; - int ret = 0; + int ret = 0, iret; if (in) { #if FF_API_OLD_CHANNEL_LAYOUT @@ -96,8 +96,8 @@ FF_DISABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS } else #endif - if ((ret = av_channel_layout_copy(&ch_layout, &in->ch_layout)) < 0) - return ret; + if ((iret = av_channel_layout_copy(&ch_layout, &in->ch_layout)) < 0) + return iret; if (av_channel_layout_compare(&s->in_ch_layout, &ch_layout) || s->in_sample_rate != in->sample_rate || s->in_sample_fmt != in->format) { @@ -116,8 +116,8 @@ FF_DISABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS } else #endif - if ((ret = av_channel_layout_copy(&ch_layout, &out->ch_layout)) < 0) - return ret; + if ((iret = av_channel_layout_copy(&ch_layout, &out->ch_layout)) < 0) + return iret; if (av_channel_layout_compare(&s->out_ch_layout, &ch_layout) || s->out_sample_rate != out->sample_rate || s->out_sample_fmt != out->format) { -- 2.37.2