avidec: workaround aac with broken block align
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 18 Sep 2012 19:47:22 +0000 (21:47 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 18 Sep 2012 20:39:54 +0000 (22:39 +0200)
Fixes Ticket1742

Based on patch by: Nikola Vranic <nikola.vranic@rt-rk.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/avidec.c

index 3e85d4e..c4d41e5 100644 (file)
@@ -676,6 +676,10 @@ static int avi_read_header(AVFormatContext *s)
                         st->codec->codec_id  = AV_CODEC_ID_ADPCM_IMA_AMV;
                         ast->dshow_block_align = 0;
                     }
+                    if(st->codec->codec_id == AV_CODEC_ID_AAC && ast->dshow_block_align <= 4 && ast->dshow_block_align) {
+                        av_log(s, AV_LOG_DEBUG, "overriding invalid dshow_block_align of %d\n", ast->dshow_block_align);
+                        ast->dshow_block_align = 0;
+                    }
                     break;
                 case AVMEDIA_TYPE_SUBTITLE:
                     st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;