From patchwork Tue Oct 29 09:45:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 16011 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 53D17447D2B for ; Tue, 29 Oct 2019 11:52:38 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2E2D068ACD0; Tue, 29 Oct 2019 11:52:38 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9092968ABFA for ; Tue, 29 Oct 2019 11:52:31 +0200 (EET) Received: by mail-wm1-f68.google.com with SMTP id q130so1665330wme.2 for ; Tue, 29 Oct 2019 02:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=937l3ZOFI6/LMWuS0esJ9Z8mBphpLbRRkGWF76i8U3w=; b=oVFI855vDIfpjZoDPhqZSP4KZIqVPY9LkSy7ja52c8Jz4OjCYENm37S/Y47Owsn10U 38pLsGdCi4SyOQUlqhLkIV1OlR3fbOGbFZLO2AafpE/mCykWzbJMOUe4swQ8y/kSQs/M m6/Wr2ayT0o0Zsqk7y6zY07DNny3MhuDwGSvlAkHIhL4pm1vrqCgOj/3f5AjmoWTkmFj qlj1iXPG1orScIGHPc/Qh0oLrFugE/1xwRfHJtDj9OzG6Eo0HFDXsuHpW/oD6EaQ5XNy PxpFNsB6VMCC+6u9oOdD1qroSwRm66J8nNrdVrwWBS39Yd9dzKrdTg+KYkBHDyiPbysl zn/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=937l3ZOFI6/LMWuS0esJ9Z8mBphpLbRRkGWF76i8U3w=; b=mhL+VBBLOT/EW4NwTOBhyL8t7kx3b7W0FCnZkll+xUY8upHoiY+n0rV7cDZgLR0rCK zo9T5lrkmcsV0aVnrghpJVYfU4FTecdJnHNpoPq7yErbrk617p9K/nbGTRngkozyOjM+ ZucPeuoIly1Bn04tDW74EnqsamZ0XWwnHcb7O2kivU6+0LUVFx6DSips4Cy7qKBKauxi 2qtfEVfXmPF0DvW2zx6T1/8XZ6gGDFI1SAbbr/LCDW9IAGcTj63g61v7HijlOw8qD7xB VS2oa8lhlbAe8+Qu3he2z4qyA3PSMXHzQ/wMvpqa2T7zi4vLjf3/wVJli9jtfktIuK4Y 0DIA== X-Gm-Message-State: APjAAAVEgnNwtbALcRjDkSNV7IpUKCfBXrNnuDzfBTptODqIk+0fj5vO dipUz5QxjtO9TnoOvjAclQXFWCBDrsk= X-Google-Smtp-Source: APXvYqwuMRbsz6DtodNI4PREtp3g85eHODRQ7q2keNp89CbVP/K2llPnLzh9GK3g/p87u1XGTzONZw== X-Received: by 2002:a05:600c:2487:: with SMTP id 7mr3276129wms.164.1572342332918; Tue, 29 Oct 2019 02:45:32 -0700 (PDT) Received: from localhost.localdomain ([212.15.160.218]) by smtp.gmail.com with ESMTPSA id u21sm2020222wmj.22.2019.10.29.02.45.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 02:45:32 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Tue, 29 Oct 2019 10:45:20 +0100 Message-Id: <20191029094520.30679-1-onemda@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH] avformat/utils: fix logic 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes decoding of wav file which is wrongly recognized as mp1 audio. Signed-off-by: Paul B Mahol --- libavformat/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index cfb6d03397..bf27531ed0 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -370,7 +370,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO && st->codecpar->sample_rate) continue; - if (st->request_probe > score && + if (st->request_probe > score || st->codecpar->codec_id != fmt_id_type[i].id) continue; st->codecpar->codec_id = fmt_id_type[i].id;