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 7E381450C5 for ; Thu, 5 Jan 2023 20:59:57 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B563168BDB6; Thu, 5 Jan 2023 22:59:55 +0200 (EET) Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9A78B68BD55 for ; Thu, 5 Jan 2023 22:59:49 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id AD454240005 for ; Thu, 5 Jan 2023 20:59:48 +0000 (UTC) Date: Thu, 5 Jan 2023 21:59:47 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230105205947.GF4028235@pb2> References: <20230105203433.GD4028235@pb2> MIME-Version: 1.0 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-Type: multipart/mixed; boundary="===============2786660147495050846==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2786660147495050846== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nqkreNcslJAfgyzk" Content-Disposition: inline --nqkreNcslJAfgyzk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 > wrote: >=20 > > 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 > > > 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 > > > --- > > > 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 =3D AV_NOPTS_VALUE; > > > } > > > +again: > > > ret =3D 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 ? > > >=20 > 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. [...] --=20 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. --nqkreNcslJAfgyzk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCY7c6QwAKCRBhHseHBAsP q3O8AJ4tSxaQMakPjKFXSutlJb+slTPtWACeN4B8/zy/Eq3/5cTkOyxAly7BC3U= =sbNd -----END PGP SIGNATURE----- --nqkreNcslJAfgyzk-- --===============2786660147495050846== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============2786660147495050846==--