Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] swresample fixes
Date: Thu, 5 Jan 2023 21:59:47 +0100
Message-ID: <20230105205947.GF4028235@pb2> (raw)
In-Reply-To: <CAPYw7P41gEY7MrzPBv73mqCfR+FEYinxBaGyDXOoQHp6ayA9cA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2553 bytes --]

On Thu, Jan 05, 2023 at 09:44:46PM +0100, Paul B Mahol wrote:
> On Thu, Jan 5, 2023 at 9:34 PM Michael Niedermayer <michael@niedermayer.cc>
> wrote:
> 
> > On Wed, Jan 04, 2023 at 05:59:14PM +0100, Paul B Mahol wrote:
> > > Patches attached.
> >
> > >  af_aresample.c |    6 ++++++
> > >  1 file changed, 6 insertions(+)
> > > 94dacb46103e2bb9fbb6e1ca40675243d15069cd
> > 0003-avfilter-af_aresample-if-frame-parameters-change-upd.patch
> > > From 3959bcb707f52339bac41acc9aec856cad3aced1 Mon Sep 17 00:00:00 2001
> > > From: Paul B Mahol <onemda@gmail.com>
> > > Date: Wed, 4 Jan 2023 17:55:10 +0100
> > > Subject: [PATCH 3/3] avfilter/af_aresample: if frame parameters change
> > update
> > >  swr context
> > >
> > > Signed-off-by: Paul B Mahol <onemda@gmail.com>
> > > ---
> > >  libavfilter/af_aresample.c | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > >
> > > diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
> > > index 7923377c8c..2744388f75 100644
> > > --- a/libavfilter/af_aresample.c
> > > +++ b/libavfilter/af_aresample.c
> > > @@ -209,8 +209,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
> > >      } else {
> > >          outsamplesref->pts  = AV_NOPTS_VALUE;
> > >      }
> > > +again:
> > >      ret = swr_convert_frame(aresample->swr, outsamplesref,
> > >                              (void *)insamplesref);
> > > +    if (ret & (AVERROR_INPUT_CHANGED | AVERROR_OUTPUT_CHANGED)) {
> > > +        swr_close(aresample->swr);
> > > +        goto again;
> > > +    }
> > > +
> > >      if (ret < 0) {
> > >          av_frame_free(&outsamplesref);
> > >          av_frame_free(&insamplesref);
> >
> > Are you sure this is not missing some flushing of internal samples ?
> >
> 
> Nope, point is not to flush all internal samples at all, just enough so
> clicks do not happen.

If there is 123ms audio in then there should be 123ms audio out
That is for the whole file. individual frames can differ due to buffering.
But if the buffers are discarded then i would expect that overall samples
are lost. This can cause problems with AV sync and timestamps too


> Clicks happen anyway so need to check why.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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-05 20:59 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
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 [this message]

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=20230105205947.GF4028235@pb2 \
    --to=michael@niedermayer.cc \
    --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