From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 5B7624395D for ; Wed, 4 Jan 2023 17:02:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8010D68BCE6; Wed, 4 Jan 2023 19:02:16 +0200 (EET) Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1391268BCDA for ; Wed, 4 Jan 2023 19:02:10 +0200 (EET) Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-142b72a728fso40455144fac.9 for ; Wed, 04 Jan 2023 09:02:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=sVGV12I/EJEcpHeMVKIlKzvVp2+Fo8UckZ+KIa2IHq8=; b=JzkvOtVF34Upsk3yOTHxb/lubK3gj724DS/boMrD1tjTZPlGOZze65j9pVrpESc+GL GIEMyApSzRtReyar5lbNTcug/WWrdCnWlqdH7E+t5O8ijZ/qVwc+xJ5qxM7mjJJLD07F 93IFlWHc/EpJEUAfScvGIAbMj3eo34T2xppZA+7r2vMc1OkbWMqFSOjxSVlhfvBoxTK4 8V8kxROam5jjW4SYNnPTne1u49P3YQ4dKM4Imz1mxl4bvyyu/byiadjtS+6ydneM4OuP 1xqLtAx4bn5YCXEW4RG07fhmDejiZoP+aWDFVZ/5nosieugKCkMWI7fOk8zUxYd9Xbwb j7IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sVGV12I/EJEcpHeMVKIlKzvVp2+Fo8UckZ+KIa2IHq8=; b=62vF8SvVyZlAo5akZAHcPApe8/ZfFSDAV8bLjpVDh+OID0QOfJNNQZxTnYtZk5s0CD djgYwyQRey8jveARlpyt6JpAXt0wTxu46F5XQeMGTrOgHONIA0ieUUh/xpt8bBm15vZp hkuUU8KC8aZ3x/kmeRDaK2n7CimMa3e0arKQi1cXnOidQaP8vKNHbg9BTwKd4SzC/+9t loLbmd7XyQAfJMPq/QQ5Dm/lVy2rfJM7VuIas+8jRsWkyKIbvQNbeowglSFxbKN49tWc K4BLcH+IaM8RvJJ4WnF4g53EoiIKGj7BjbBUoFYbmDjAVdA2fp4kV5kowsEcmiXh6BXN 4h1w== X-Gm-Message-State: AFqh2koJbJ7AU07KCT14UiZezH87KAyy0EO17C4W4yugEel10psT5y08 jemYJn2tKsf+UGNLzlx/pAvggPjhCF0= X-Google-Smtp-Source: AMrXdXvo5TqWdSN7l/NaIJPeiWRf8aTjQiIt99hy3vuP7YnzFsSkxReUegn5wIyvN+5RTo69udKg3g== X-Received: by 2002:a05:6870:ed45:b0:150:908c:afab with SMTP id ex5-20020a056870ed4500b00150908cafabmr7266179oab.2.1672851727959; Wed, 04 Jan 2023 09:02:07 -0800 (PST) Received: from [192.168.0.14] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id r17-20020a056870415100b0014c8b5d54b2sm15811990oad.20.2023.01.04.09.02.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Jan 2023 09:02:07 -0800 (PST) Message-ID: <6d9b6190-4658-4821-0928-bfbc8c660ed2@gmail.com> Date: Wed, 4 Jan 2023 14:02:06 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 To: ffmpeg-devel@ffmpeg.org References: Content-Language: en-US From: James Almer In-Reply-To: Subject: Re: [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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 1/4/2023 1:59 PM, Paul B Mahol wrote: > 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) { Patch 2/3 LGTM, and it should be backported to 5.1. Also, FWIW, these copies will be unnecessary after the old channel layout API is dropped, so this can be undone later. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".