Browse code

avformat/avidec: add mp2 to the list of exceptions instead of generally treating dshow_block_align==1 special

Fixes Ticket4552

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2015/05/17 08:34:35
Showing 1 changed files
... ...
@@ -129,7 +129,7 @@ static inline int get_duration(AVIStream *ast, int len)
129 129
 {
130 130
     if (ast->sample_size)
131 131
         return len;
132
-    else if (ast->dshow_block_align > 1)
132
+    else if (ast->dshow_block_align)
133 133
         return (len + ast->dshow_block_align - 1) / ast->dshow_block_align;
134 134
     else
135 135
         return 1;
... ...
@@ -872,7 +872,8 @@ static int avi_read_header(AVFormatContext *s)
872 872
                         st->codec->codec_id    = AV_CODEC_ID_ADPCM_IMA_AMV;
873 873
                         ast->dshow_block_align = 0;
874 874
                     }
875
-                    if (st->codec->codec_id == AV_CODEC_ID_AAC && ast->dshow_block_align <= 4 && ast->dshow_block_align) {
875
+                    if (st->codec->codec_id == AV_CODEC_ID_AAC && ast->dshow_block_align <= 4 && ast->dshow_block_align ||
876
+                        st->codec->codec_id == AV_CODEC_ID_MP2 && ast->dshow_block_align <= 4 && ast->dshow_block_align) {
876 877
                         av_log(s, AV_LOG_DEBUG, "overriding invalid dshow_block_align of %d\n", ast->dshow_block_align);
877 878
                         ast->dshow_block_align = 0;
878 879
                     }