Justin Ruggles <[email protected]> added the comment:

Setting avctx->channels for each frame decode fixes the issue.  That is 
what the AC-3 decoder does.  In this case, ffmpeg still reports it as 5.0 
due to the container, but it is changed to 5.1 by the decoder and decodes 
properly.

____________________________________________________
FFmpeg issue tracker <[email protected]>
<https://roundup.ffmpeg.org/roundup/ffmpeg/issue850>
____________________________________________________
Index: libavcodec/dca.c
===================================================================
--- libavcodec/dca.c	(revision 20544)
+++ libavcodec/dca.c	(working copy)
@@ -1260,7 +1260,7 @@
        unset. Ideally during the first probe for channels the crc should be checked
        and only set avctx->channels when the crc is ok. Right now the decoder could
        set the channels based on a broken first frame.*/
-    if (!avctx->channels)
+    //if (!avctx->channels)
         avctx->channels = channels;
 
     if(*data_size < (s->sample_blocks / 8) * 256 * sizeof(int16_t) * channels)

Reply via email to