Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] swresample fixes
Date: Wed, 4 Jan 2023 14:02:06 -0300
Message-ID: <6d9b6190-4658-4821-0928-bfbc8c660ed2@gmail.com> (raw)
In-Reply-To: <CAPYw7P72E=6rM5W3Modq2qD+-SpcaFDE+N1Yec4jd6=zZZRpeA@mail.gmail.com>

On 1/4/2023 1:59 PM, Paul B Mahol wrote:
> From 0415ed37bee0c2b640920edad87ec927dda95fb5 Mon Sep 17 00:00:00 2001
> From: Paul B Mahol <onemda@gmail.com>
> 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 <onemda@gmail.com>
> ---
>  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".

  reply	other threads:[~2023-01-04 17:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04 16:59 Paul B Mahol
2023-01-04 17:02 ` James Almer [this message]
2023-01-04 17:02 ` Andreas Rheinhardt
2023-01-04 17:18 ` Andreas Rheinhardt
2023-01-04 17:25   ` Paul B Mahol
2023-01-04 17:26 ` Andreas Rheinhardt
2023-01-04 17:35   ` Paul B Mahol
2023-01-04 17:37     ` Andreas Rheinhardt
2023-01-05 20:21 ` Michael Niedermayer
2023-01-05 20:34 ` Michael Niedermayer
2023-01-05 20:44   ` Paul B Mahol
2023-01-05 20:59     ` Michael Niedermayer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6d9b6190-4658-4821-0928-bfbc8c660ed2@gmail.com \
    --to=jamrial@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git