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 C68A049EB9 for ; Wed, 13 Mar 2024 03:01:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C038C68D014; Wed, 13 Mar 2024 05:01:27 +0200 (EET) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ECE7168CB1D for ; Wed, 13 Mar 2024 05:01:20 +0200 (EET) Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-6e6aaa2f02cso972896b3a.2 for ; Tue, 12 Mar 2024 20:01:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710298878; x=1710903678; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=aXQXOaqGRR9PdkzuNr6hrZQroSlqexihYOhf4AINTyI=; b=foZcAP55q2uCAeP2vTyMaNb7FaVtNn7uP5tdVK28wQ2Q39IPZvlK2OY52qIkiXf6ar nXuFVwxIu5hLGNQD32Wmbx9gm62EG6S7dJC8pSxZlRqgHjKrUGGvxcbf2P6GErvCmocu HNR0cn4aoLPIvhRt8dtis7QkaeM9uu+Mwa63fq22uLypd6otV20QtEHtTU+zb2k4DeTR 7vquYTVzGMl04RRk9wh5KrzU2eGJ6ABh7cS5vwDZx69NVQY+1Q8Egrt9pEMq6EyMrBrh S26Uwqqc6LxU+IpNPtWB6esKQq3GdjjPR5k0QMqanupN5w3mGXtqgQL7amwmSk4x788Y HWKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710298878; x=1710903678; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aXQXOaqGRR9PdkzuNr6hrZQroSlqexihYOhf4AINTyI=; b=WBQxy6pv62xvzeDqC1RPX9O+f2yancvjgUt8/WlR5REimFei1MsJv7XxqZEhsVPJNU ZijU461BeF3aY93ij7HMvA8TWKWIdr1uyEyoPY9qMBemT2Q/xOk5jk/bY2zLNAz0vGaQ DrvdpwVwuL9X1OkgywkBbvbvPBNnAPx/DlihKltiTQKUU/k8QPTFK1tDJnz1p4dVGfbS a/5EZmEGgb6XMR2FM/ghNj8pEGinjdzdFN7AkqPFNmC3zpZlOqFYCatZ6ODqCGrGM7SU P710TaZmxjH8VqJv0ezOrcFSHTDFb3/yKExZ3LqJb3Ildv4OIAhvfAhsfO5lK9LiibFb 1xBg== X-Gm-Message-State: AOJu0Yw8P4XGt/9wppvE1xatwgLqlsue1y/SqaLAOIE82iAAkNFEWnj6 K+yB73t5nCRuy84cd+sPe1oaSGIpdgvQ8hsC2/0lKZPnAPmSyQIusmMBZ782 X-Google-Smtp-Source: AGHT+IHEjoKMyejFg/jwBfYCXY3sCXFGS9qTJnNCDbP6VaVbISVRkumj3G2bnYJ3lvFqL/1ic4hqdg== X-Received: by 2002:a05:6a20:6a9c:b0:1a1:6728:344e with SMTP id bi28-20020a056a206a9c00b001a16728344emr7109795pzb.41.1710298877709; Tue, 12 Mar 2024 20:01:17 -0700 (PDT) Received: from homestead.aragog.com ([2605:a601:a9a2:a100:67c:16ff:fe02:37f0]) by smtp.gmail.com with ESMTPSA id b10-20020a170902650a00b001db6da30331sm7605810plk.86.2024.03.12.20.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 20:01:17 -0700 (PDT) From: Pavel Koshevoy To: ffmpeg-devel@ffmpeg.org Date: Tue, 12 Mar 2024 21:01:16 -0600 Message-Id: <20240313030116.27113-1-pkoshevoy@gmail.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] lavfi/atempo: avoid asendcmd assertion failure 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: Rajiv Harlalka 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: From: Rajiv Harlalka Check for zeros equal to the total samples early, because in that case we would already be leaving the first few frames out. Fixes trac ticket #10692 --- libavfilter/af_atempo.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c index 4621b67b03..654b080e89 100644 --- a/libavfilter/af_atempo.c +++ b/libavfilter/af_atempo.c @@ -531,21 +531,21 @@ static int yae_load_frag(ATempoContext *atempo, dst = frag->data; start = atempo->position[0] - atempo->size; - zeros = 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; - } + // 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) { + memset(dst, 0, zeros * atempo->stride); + dst += zeros * atempo->stride; + } + // get the remaining data from the ring buffer: na = (atempo->head < atempo->tail ? atempo->tail - atempo->head : -- 2.35.3 _______________________________________________ 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".