diff mbox series

[FFmpeg-devel] avcodec/aac_ac3_parser: fix channel information parsing

Message ID CAL_-C8mFOp7DQbCyOVijDDE3voJBzXiiND12VD5SSAzouaxQpw@mail.gmail.com
State New
Headers show
Series [FFmpeg-devel] avcodec/aac_ac3_parser: fix channel information parsing | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Piotr Uracz Jan. 25, 2021, 11:04 a.m. UTC
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(-)

--

Comments

Paul B Mahol Jan. 31, 2021, 3:51 p.m. UTC | #1
probably fine, anyone against?
diff mbox series

Patch

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;
         }