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 F1C214944F for ; Tue, 12 Mar 2024 13:09:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6CF4668D011; Tue, 12 Mar 2024 15:09:10 +0200 (EET) Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ABADB68CD53 for ; Tue, 12 Mar 2024 15:09:04 +0200 (EET) Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a4627a7233aso352355766b.1 for ; Tue, 12 Mar 2024 06:09:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710248944; x=1710853744; darn=ffmpeg.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Dwa26wJmJhXockoItZFhjd7ObCEQTpgqTzFfDX3IKtM=; b=QokmEmzUvwh6FMrBiLYTZaAjDantNY2MsWf068xBYbyUxqgDsXDt/zB8nLKNAaP3WO XBeKFOaugQVXWUbI29yMijaP0LeZ+RXBa24jwVmyljHLR5lZCZgl52T9AuABplbfjtxu HskRrUPE1Ug0WnOFa2fUF9T32H/RjfzmlSh4TgOGmvONw5APocr8UMLmM5qiv1nne49D L+KlatpfSMRdfxPlmKJs8eedKPMjDa5g9DKiwi8Za9EHyMhUEpdhdcmyNF1INDxNvr6l hswEydrTEue2Oj/7o5F6lbSKe5VD8jc6lpDcyA9PWzhq7woZFrVIT6sJaV6vCQxYI6TB KtTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710248944; x=1710853744; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Dwa26wJmJhXockoItZFhjd7ObCEQTpgqTzFfDX3IKtM=; b=SUIAcFHd5GE2FYtQJt3K+RDGLxjjgvS5pkuFW9etvAVwHIViMKyX0gL/HxN+Wem7e/ rTwzjvnLulMnmK5aR1/pFqlxmTnoeXuYi3+YRKM8AuMJa291QTa+UPEtd9cXIeX/ClYr kvZoLaqZWsjE8xvXIKBYzvvdq7Xtdj5HL+/kWGRHiDxCEtKi0wM6t+1MFVcWs0iaqCvM AMM/PT5/xuNs/anSXDAwifV9U+Q3y9atint60U8VRPSqViZuKiIBvqD3vWJAQzcwB0ey I9UOmkbXbvrXLFOOLiClXHDCOTrKQUh+NNMyqxgcn0i7/MMChXx0hHgXd023A9scJYpI RAMw== X-Gm-Message-State: AOJu0Yz5ahIj0KOnCAgpCoxJ9bAB2hwkx/4znRo3w1vflia+gXzkBBK2 J78ui1A3usAFNsRGhPmt9Wn9z42+oqlGHJMuNxtDbrqNoQWb4RAz3WVxSQtLJkvBwtO2pdiAEXd AfpwGrgBh6nklg4UgE5/puhzLIG7fymq8 X-Google-Smtp-Source: AGHT+IHWd+/7sIhf7zFfKdxRUSZyHus5EyYZU8OqB+w3ZTQWIgwc3l44B5047k3s8Kk5rjSqJBADSgtrsf5m0DR6KWI= X-Received: by 2002:a17:907:c283:b0:a44:b96:2811 with SMTP id tk3-20020a170907c28300b00a440b962811mr8807439ejc.29.1710248943182; Tue, 12 Mar 2024 06:09:03 -0700 (PDT) MIME-Version: 1.0 References: <2bc308e6-91ac-4d0c-8e31-b7e3486bdcc2@gmail.com> In-Reply-To: From: Pavel Koshevoy Date: Tue, 12 Mar 2024 07:08:54 -0600 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] af_tempo.c: fix checking of samples and zero frame counts 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 Cc: Thilo Borgmann , cosmin@cosmin.at Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Tue, Mar 12, 2024, 02:52 Rajiv Harlalka wrote: > On 3/8/24 4:34 AM, Rajiv Harlalka wrote: > > Check for zeros equal to the total samples early, because in case the > > check is true we would already be leaving the first few frames out. > > > > Signed-off-by: Rajiv Harlalka > > #10692 > > --- > > libavfilter/af_atempo.c | 13 ++++++------- > > 1 file changed, 6 insertions(+), 7 deletions(-) > > > > diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c > > index 4621b67b03..8f31c5beaf 100644 > > --- a/libavfilter/af_atempo.c > > +++ b/libavfilter/af_atempo.c > > @@ -531,21 +531,20 @@ static int yae_load_frag(ATempoContext *atempo, > > dst = frag->data; > > start = atempo->position[0] - atempo->size; > > - zeros = 0; > > + // what we don't have we substitute with zeros: > > + zeros = frag->position[0] < start ? FFMIN(start - > > frag->position[0], (int64_t)nsamples) : 0; > > + > > + if (zeros == nsamples) { > > + return 0; > > + } > > if (frag->position[0] < start) { > > - // what we don't have we substitute with zeros: > > - zeros = FFMIN(start - frag->position[0], (int64_t)nsamples); > > av_assert0(zeros != nsamples); > > memset(dst, 0, zeros * atempo->stride); > > dst += zeros * atempo->stride; > > } > > - if (zeros == nsamples) { > > - return 0; > > - } > > - > > // get the remaining data from the ring buffer: > > na = (atempo->head < atempo->tail ? > > atempo->tail - atempo->head : > > Just a quick note to bring attention to a code patch I submitted > recently. It fixes bug #10692 from the bug tracker on the > libavfilter/av_atempo filter. A review would be greatly appreciated. > > Thanks, > Rajiv > > _______________________________________________ > 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". > I should be able to test the patch tonight after work. Thank you, Pavel. _______________________________________________ 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".