Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Paul B Mahol <onemda@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] swresample fixes
Date: Wed, 4 Jan 2023 18:25:58 +0100
Message-ID: <CAPYw7P4L2nAGV1UYB8asQ3sRpUUz-kCajG_0WamidkS0jnjHRQ@mail.gmail.com> (raw)
In-Reply-To: <AS8P250MB07446FC990F56C632CF504F48FF59@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>

On Wed, Jan 4, 2023 at 6:18 PM Andreas Rheinhardt <
andreas.rheinhardt@outlook.com> wrote:

> Paul B Mahol:
> > diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
> > index 971c861d0e..7923377c8c 100644
> > --- a/libavfilter/af_aresample.c
> > +++ b/libavfilter/af_aresample.c
> > @@ -209,18 +209,16 @@ FF_ENABLE_DEPRECATION_WARNINGS
> >      } else {
> >          outsamplesref->pts  = AV_NOPTS_VALUE;
> >      }
> > -    n_out = swr_convert(aresample->swr, outsamplesref->extended_data,
> n_out,
> > -                                 (void *)insamplesref->extended_data,
> n_in);
> > -    if (n_out <= 0) {
> > +    ret = swr_convert_frame(aresample->swr, outsamplesref,
> > +                            (void *)insamplesref);
>
> Don't know whether the actual change has advantages, but you should not
>

It adds better support for runtime change of input/output sample rates.
Instead of re-initializing whole filter graph.


> cast here. The cast above exists because there is no automatic cast
> T**->const T** (it is actually unsafe; we should change swr_convert() to
> accept const uint8_t *const * for in and uint8_t *const * for out at the
> next major version bump, but even then C requires the cast). There is no
> reason for a cast with the new code.
>
> > +    if (ret < 0) {
> >          av_frame_free(&outsamplesref);
> >          av_frame_free(&insamplesref);
> > -        return 0;
> > +        return ret;
> >      }
> >
> >      aresample->more_data = outsamplesref->nb_samples == n_out; //
> Indicate that there is probably more data in our buffers
> >
> > -    outsamplesref->nb_samples  = n_out;
> > -
> >      ret = ff_filter_frame(outlink, outsamplesref);
> >      av_frame_free(&insamplesref);
> >      return ret;
>
> _______________________________________________
> 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".
>
_______________________________________________
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:21 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
2023-01-04 17:02 ` Andreas Rheinhardt
2023-01-04 17:18 ` Andreas Rheinhardt
2023-01-04 17:25   ` Paul B Mahol [this message]
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=CAPYw7P4L2nAGV1UYB8asQ3sRpUUz-kCajG_0WamidkS0jnjHRQ@mail.gmail.com \
    --to=onemda@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