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 BFE9748738 for ; Sat, 16 Dec 2023 10:15:37 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 16A2268D0C9; Sat, 16 Dec 2023 12:15:36 +0200 (EET) Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7AEFA68CF9C for ; Sat, 16 Dec 2023 12:15:29 +0200 (EET) Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4Sshmb2b66z9skk for ; Sat, 16 Dec 2023 11:15:27 +0100 (CET) Message-ID: <6dc645b2-6ee5-46e9-82d7-5ff2c18a2ff9@gyani.pro> Date: Sat, 16 Dec 2023 15:45:24 +0530 MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org References: <20231215070046.771-1-ffmpeg@gyani.pro> <20231215181642.GS6420@pb2> Content-Language: en-US From: Gyan Doshi In-Reply-To: <20231215181642.GS6420@pb2> X-Rspamd-Queue-Id: 4Sshmb2b66z9skk Subject: Re: [FFmpeg-devel] [PATCH v2] swr/swresample: avoid reapplication of firstpts 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 2023-12-15 11:46 pm, Michael Niedermayer wrote: > On Fri, Dec 15, 2023 at 12:30:46PM +0530, Gyan Doshi wrote: >> During a resampling operation where >> >> 1) user has specified first_pts >> 2) SWR_FLAG_RESAMPLE is not set initially (directly or otherwise) >> 3) first_pts has been fulfilled (always using hard compensation) >> >> then upon first encountering a delay where a soft compensation is >> required, swr_set_compensation will lead to another init of swr which >> will reset outpts to the specified firstpts thus leading to an output >> frame having its pts = firstpts. When the next input frame is received, >> swr will see a large delay and inject silence from firstpts to the >> current frame's pts. This can lead to severe desync and in worst case, >> loss of audio playback. >> >> Parameter firstpts initialized to AV_NOPTS_VALUE in swr_alloc and then >> checked in swr_init to avoid resetting outpts, thus avoiding reapplication >> of firstpts. >> >> Fixes #4131. >> --- >> libswresample/options.c | 1 + >> libswresample/swresample.c | 5 +++-- >> 2 files changed, 4 insertions(+), 2 deletions(-) > LGTM > > also can a fate test be added for this ? v3 with fate test sent. Regards, Gyan _______________________________________________ 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".