From patchwork Sun Dec 18 00:14:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Koshevoy X-Patchwork-Id: 1847 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.86 with SMTP id o83csp510836vsa; Sat, 17 Dec 2016 16:20:23 -0800 (PST) X-Received: by 10.28.199.143 with SMTP id x137mr1806371wmf.0.1482020423309; Sat, 17 Dec 2016 16:20:23 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v205si9571020wmg.47.2016.12.17.16.20.22; Sat, 17 Dec 2016 16:20:23 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 33F6F689950; Sun, 18 Dec 2016 02:20:12 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A9F1A6806D4 for ; Sun, 18 Dec 2016 02:20:05 +0200 (EET) Received: by mail-pg0-f68.google.com with SMTP id b1so3955994pgc.1 for ; Sat, 17 Dec 2016 16:20:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ixXV6ET1NgdqYZVGiEKdwpYwnvJJIl6KfuUU+5/b/4s=; b=qUWtljsdzLAjpnKiv4k/eQDTJdrcPUOWPLSu0G7C4nevHxew3sPnUS3csPSO3VIxDR c9Sxd1jYlnZ32+IfMVRZzeGffKF1pbfZfHVK9yxYf8sEDltJQhcO/4YSJ0CW3jwHAXjX lQA7P5/sIf1bAGl47+1crGxF4pJEcuecTeXqjxnwRzyiuX6ActCNCm4AGm8Fxoc/vUT6 D+53a0nIcJ7XYrksKWtd/jntElvsIlLKxjNRvFprpaVJjgscl4qenwq2cwRjOB5zbeSl jtCvajzooTmQYl68mse6TIlEWqquSQc3P/m7Y8Y+i96NWd17LAnJ8in/VypwNg3VmFzQ /RsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ixXV6ET1NgdqYZVGiEKdwpYwnvJJIl6KfuUU+5/b/4s=; b=HQ6QN10Su0pdiFO96mZGlbIusJ3reIpf6aqf+f1Z1ojxJf5K89oXQhwHXhr/lvO05E 7r2EpQWrmmwdONVCJNqfHFUk6vhn3cXUJC7l2abSJVx4YnkvPpTL7pVp0njI3vto0qsv r2ayxbcqcyvxmmxFu7Uhm01Dud3CtrBUHydJx/m4mA9PNKOcNbJgRBm2Z+PjldWlnEaL +jBnZmqIDo1/oTBv/bHgbfiHKA+YeqZdGWyGqyfqkwdwNSBrsbqW2KA9HxYEE0PFCo9o aY6/CLv/quoPkhBufwDH3sOOYEB/0D86sZYmvwDY1eAlqN2PJnjj7UWqrqRr0SRyLOh4 1w+A== X-Gm-Message-State: AKaTC02BHGPkRCC4vIaTK3sTRyKjofKPLcZhIyvw+Qvbx3+eZevQ7XwoTyVG/noh2xQrOQ== X-Received: by 10.84.192.131 with SMTP id c3mr21454910pld.149.1482020095513; Sat, 17 Dec 2016 16:14:55 -0800 (PST) Received: from homestead.aragog.com ([136.60.170.51]) by smtp.gmail.com with ESMTPSA id f3sm21325326pga.45.2016.12.17.16.14.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 17 Dec 2016 16:14:54 -0800 (PST) From: pkoshevoy@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Sat, 17 Dec 2016 17:14:48 -0700 Message-Id: <1482020088-1607-1-git-send-email-pkoshevoy@gmail.com> X-Mailer: git-send-email 2.6.6 In-Reply-To: References: Subject: [FFmpeg-devel] [PATCH] lavfi/atempo: Avoid false triggering an assertion failure X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Pavel Koshevoy MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Pavel Koshevoy Steps to reproduce: ./ffmpeg_g -f s16be -i /dev/null -af atempo=0.5 -y /tmp/atempo.wav --- libavfilter/af_atempo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c index 59b08ec..a487882 100644 --- a/libavfilter/af_atempo.c +++ b/libavfilter/af_atempo.c @@ -914,8 +914,8 @@ static int yae_flush(ATempoContext *atempo, atempo->state = YAE_FLUSH_OUTPUT; - if (atempo->position[0] == frag->position[0] + frag->nsamples && - atempo->position[1] == frag->position[1] + frag->nsamples) { + if (atempo->position[0] >= frag->position[0] + frag->nsamples && + atempo->position[1] >= frag->position[1] + frag->nsamples) { // the current fragment is already flushed: return 0; }