From patchwork Wed Jul 25 01:15:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 9787 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp236078jad; Tue, 24 Jul 2018 18:15:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcjd9kQOx7VrrW2xIhVM2B0SzGFXzSJn+giNSjWRtK6QGvGbF0UZbXsxJWXotnTneSveG+q X-Received: by 2002:a1c:148f:: with SMTP id 137-v6mr3099028wmu.61.1532481355872; Tue, 24 Jul 2018 18:15:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532481355; cv=none; d=google.com; s=arc-20160816; b=W2xi8HZva/4R2DsSfH6OKl3ZpJYKGdijyUaMOojKhaVzm0xNiLo6jWg+6fJ3TuQ+0W WUsgM4i8d4D+YUXErzuJw4DjHxUN7azkcVJH4NG+0cdVgqkgmM80UjKvIKmvJamO3CvE 5Eiv+rOSqU1vEs+DwwKZjQUS9ZT0Kwsvh7XlE5hajQGacgejhZ6ywVFYccA8+BGweS0z qzQ85VPYQU2Z9NbeyrSVX8fviyw0HpGB+284AQZlXkvw9PJ/zEfHc0Po17mkL6kw2Bei AksGdOEts9TcLlkRlnHL8HfBtB/W1jZBFxA9e1mWGOKN2X2ZmZOZni+MHiEQv8Lzc4K6 LIQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=JX3YUeLmJYlb63QByHLm+4T/ALr3SKOr4kGAVycdxSU=; b=RuWp2fa56UvOW6yFfB/KB7zMCYZgU5QdQlpfehRYmLuZDFhhLfs+xe61tJ5fS8H/0t yyIzPVrLbXtrv16YrgekzUfpMgCxjk09G3ckzTuqJnMPpDcETmeD1FZNTRCqpNu4f4Oz 7S1J1xoSl8wQnLRjB//RhahL5nbEkrQdzQmvUGB3+rwfaOs04gAP5j8KFrL6mhuW264p ZvJ+OuNQ9D6qy5TyIvBkjt6soechZNgLVjcqeOJL0irKTiMFECi7seBCJGrCeO1QM7Hr PQrXCkxjEomDhu+Y2CjeUlJFRph23eCx6ePykTyhjvOpr8XiqScTocK4n256f5p28Uet gwdg== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n11-v6si9652127wrs.204.2018.07.24.18.15.54; Tue, 24 Jul 2018 18:15:55 -0700 (PDT) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5AA98689F10; Wed, 25 Jul 2018 04:15:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe06-2.mx.upcmail.net (vie01a-dmta-pe06-2.mx.upcmail.net [84.116.36.15]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B167B6882E2 for ; Wed, 25 Jul 2018 04:15:32 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fi8P4-00009U-EQ for ffmpeg-devel@ffmpeg.org; Wed, 25 Jul 2018 03:15:46 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id EpFf1y00y0S5wYM01pFgjU; Wed, 25 Jul 2018 03:15:40 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 25 Jul 2018 03:15:20 +0200 Message-Id: <20180725011520.17371-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 Subject: [FFmpeg-devel] [PATCH] swresample/swresample: Fix input channel count in resample_first computation 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Found-by: Marcin Gorzel Signed-off-by: Michael Niedermayer --- libswresample/swresample.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswresample/swresample.c b/libswresample/swresample.c index 5bd39caac4..6d28e6a798 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -318,7 +318,7 @@ av_cold int swr_init(struct SwrContext *s){ av_assert0(s->used_ch_count); av_assert0(s->out.ch_count); - s->resample_first= RSC*s->out.ch_count/s->in.ch_count - RSC < s->out_sample_rate/(float)s-> in_sample_rate - 1.0; + s->resample_first= RSC*s->out.ch_count/s->used_ch_count - RSC < s->out_sample_rate/(float)s-> in_sample_rate - 1.0; s->in_buffer= s->in; s->silence = s->in;