From patchwork Mon Jan 25 11:04:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piotr Uracz X-Patchwork-Id: 25156 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 245CC44B9AE for ; Mon, 25 Jan 2021 13:31:02 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F0A1A689C96; Mon, 25 Jan 2021 13:31:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ACFC3680795 for ; Mon, 25 Jan 2021 13:30:55 +0200 (EET) Received: by mail-lf1-f48.google.com with SMTP id h7so17194937lfc.6 for ; Mon, 25 Jan 2021 03:30:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vewd.com; s=google; h=mime-version:from:date:message-id:subject:to; bh=2OeTEpjYYcGCJ+QrIfWy4QfusVu4Uxb65u3VtBn8654=; b=wnLny5RMJsWCebO3ACbHeeig4vknqc1Z4k8J6/l/YHZhHp6UolorECJhM/cOCf7w7U l+1m6wU6jJvu0Q32RfzaHwEe9/nclr0+VJdCroqzFr8STqzESDTsoAcQRlBjYbwVmk4h Tos1fep+zImbJScp8+tMITiZBmceXOqlQs7iNiaept9V7V0vlWBwQJx/6a31Mlkut+WI gRrVyQYiGCi8+2bo0iY/hJcya8KwVFh5G2bJDmbAoGigvicThuhzqrSxWgsyss8g6Jpy 2fovVxN18JcsEtVSCRiiF4mZT5hPxn4C6MS0/3WyJfmeO6aRV3kdvTZATL2GoyC0/K/w tmjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=2OeTEpjYYcGCJ+QrIfWy4QfusVu4Uxb65u3VtBn8654=; b=UaBStmAOLlmqS6mbWeyyciXE0ZRXZITb3lei70gGg3387Dgi+RM+M5s0vFi9B98Jly jMbkawOzUhJBDp1lZbwb7w0HhK8BC3H4WXjhWEefSaa75f7GpU5TbaO3qyd3hT9P5ChA WhRYZSIZnuwJLbdJBknuvLSaYEGvU7f5tIfrl2djoqFVqsM5UcC9U9FsTaeJmpGUvcRH TeMuTRLNvmJDx+wQh4KwfRSfSAdLMhFu1nhQJmq6YWmo3yk2CbxA3ygPdCVQq+DXnZX4 lJdO8FFTw4OfcYqZACTftLFKchKX6EFth16K+aKAq1siZzPUiZzwWVKvI+6x/you8Yg6 lpDw== X-Gm-Message-State: AOAM530qd4Jb+2OuCrxyIMWTlVwcebVc5Kkl0a2TVjuCbEze7JemhH6p uC0a2aMDNTk9k5uBlx67AFrL3AEue7WMYVSMCsFkb9WtO43Vfg== X-Google-Smtp-Source: ABdhPJwhNI3DHfgrhS+3ZRQVbOtE8xppG6Rk/GlkTgNHlE+nPkeylkBMd+S446mlgtwumvZSyv4zOmfv4J5oS9sUGl4= X-Received: by 2002:a50:d685:: with SMTP id r5mr45596edi.248.1611572690252; Mon, 25 Jan 2021 03:04:50 -0800 (PST) MIME-Version: 1.0 From: Piotr Uracz Date: Mon, 25 Jan 2021 12:04:36 +0100 Message-ID: To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH] avcodec/aac_ac3_parser: fix channel information parsing 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes bug https://trac.ffmpeg.org/ticket/7372 Summary of the bug: When ffmpeg is compiled with ac3 decoder disabled ffmpeg is unable to extract channel information from ts file. --- libavcodec/aac_ac3_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c index e5d4b53339..e84d30aea2 100644 --- a/libavcodec/aac_ac3_parser.c +++ b/libavcodec/aac_ac3_parser.c @@ -89,7 +89,7 @@ get_next: the frame). */ if (avctx->codec_id != AV_CODEC_ID_AAC) { avctx->sample_rate = s->sample_rate; - if (avctx->codec_id != AV_CODEC_ID_EAC3) { + if (!CONFIG_EAC3_DECODER || avctx->codec_id != AV_CODEC_ID_EAC3) { avctx->channels = s->channels; avctx->channel_layout = s->channel_layout; } @@ -99,7 +99,7 @@ get_next: /* Calculate the average bit rate */ s->frame_number++; - if (avctx->codec_id != AV_CODEC_ID_EAC3) { + if (!CONFIG_EAC3_DECODER || avctx->codec_id != AV_CODEC_ID_EAC3) { avctx->bit_rate += (s->bit_rate - avctx->bit_rate) / s->frame_number; }