From patchwork Sat Feb 18 22:46:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Koshevoy X-Patchwork-Id: 2601 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.22 with SMTP id n22csp249930vsb; Sat, 18 Feb 2017 14:55:27 -0800 (PST) X-Received: by 10.28.131.72 with SMTP id f69mr6551126wmd.140.1487458527632; Sat, 18 Feb 2017 14:55:27 -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 s93si18350929wrc.222.2017.02.18.14.55.26; Sat, 18 Feb 2017 14:55:27 -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 sp=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 9A6C6680AB1; Sun, 19 Feb 2017 00:55:16 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A2D4C687EEF for ; Sun, 19 Feb 2017 00:55:09 +0200 (EET) Received: by mail-pf0-f193.google.com with SMTP id c193so2087091pfb.3 for ; Sat, 18 Feb 2017 14:55:16 -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=1UNzLxSHXpw/E5ikMsPt5gigqyYI6+uRxqc0lVEs7AE=; b=IzfvHnemziDnTAjKfDx1xWrhuBU87D5aift6OaT11UhzJCOoPu4Wsw/UCQPGRaXLzI EnSxlm5nCly97Ler4j1Mc/4ePAHLmKwm9+6qp50K2A+gNuPcr2Lp6SrF8ZQJhXOOMC2z HGP1S9JU0E+eEiUy4pRdRmM+GkU+mZSOYFC7SiFrcV67WGrQXYr3aov3MtASmDXZ3scF ZPxNubu1IZDNoOdt18Y31Bnw+uMsNXu8D0WD0/Gu+BK1A3B6jQaHLAUygEBBKtNGEq1+ bo1nO1RW5M3+FnJM4cGEhhwVI183vN32RHkb+ou8tAW1qDmh3ldl5qxaIj/aOZmA++TI GV8w== 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=1UNzLxSHXpw/E5ikMsPt5gigqyYI6+uRxqc0lVEs7AE=; b=OqBr53jTwN9N2IKHASGvwSldBxKJhQyKJBe+oC8Z4YvF8PXefQ0Ks/tkgILs4LBx3G g9WG04Sl1JTNcO5PnNhSHUt7C2fK0QhXe14Duj6+oeaSi5RRP1sYrkShBtRGaEyFdLxE fz25mKp+ZOC5JyBNJNOAIQY7hq9kdDAQGP7uS01ugrAz88ApBjYIz6NR2tk+uIcYzvoB ZjZIzUfY8bn5hKOK8TiFS/dk2BRsPz3rRnPX3sdH92wn0SKpSF3bZ8vvN+8bN9B3kkMP gCcYvvbpNLm4Ig7N9Pun8s5Vlluu6zXE2PNSuUL3GhexknWTEi987HpvlGeb9REp63K8 dUZw== X-Gm-Message-State: AMke39kBPRYstk4aUJ+fGfU3EGSDKxM8GiVigUq6G2yZxHxnyZFNh9bTOeOHlZOdzhGkqQ== X-Received: by 10.99.95.216 with SMTP id t207mr18624315pgb.0.1487458023227; Sat, 18 Feb 2017 14:47:03 -0800 (PST) Received: from homestead.aragog.com ([136.60.170.51]) by smtp.gmail.com with ESMTPSA id c11sm26938499pfe.68.2017.02.18.14.47.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Feb 2017 14:47:02 -0800 (PST) From: pkoshevoy@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Sat, 18 Feb 2017 15:46:42 -0700 Message-Id: <1487458002-6569-1-git-send-email-pkoshevoy@gmail.com> X-Mailer: git-send-email 2.6.6 In-Reply-To: References: Subject: [FFmpeg-devel] [PATCH] avfilter/af_atempo: fix drift calculation, ticket #6157 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 --- libavfilter/af_atempo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c index a487882..eb62656 100644 --- a/libavfilter/af_atempo.c +++ b/libavfilter/af_atempo.c @@ -697,11 +697,11 @@ static int yae_adjust_position(ATempoContext *atempo) AudioFragment *frag = yae_curr_frag(atempo); const double prev_output_position = - (double)(prev->position[1] - atempo->origin[1] + atempo->window / 2); + (double)(prev->position[1] - atempo->origin[1] + atempo->window / 2) * + atempo->tempo; const double ideal_output_position = - (double)(prev->position[0] - atempo->origin[0] + atempo->window / 2) / - atempo->tempo; + (double)(prev->position[0] - atempo->origin[0] + atempo->window / 2); const int drift = (int)(prev_output_position - ideal_output_position);