[FFmpeg-cvslog] avformat/avidec: add mp2 to the list of exceptions instead of generally treating dshow_block_align ==1 special

Michael Niedermayer git at videolan.org
Sun May 17 03:24:49 CEST 2015


ffmpeg | branch: release/2.6 | Michael Niedermayer <michaelni at gmx.at> | Sun May 17 01:34:35 2015 +0200| [af5917698bd44f136fd0ff00a9e5f8b5f92f2d58] | committer: Michael Niedermayer

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 at gmx.at>
(cherry picked from commit 488383afd1275f6da53e9c83bc209c2f70d768ef)

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=af5917698bd44f136fd0ff00a9e5f8b5f92f2d58
---

 libavformat/avidec.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 9bb3920..08cc956 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -128,7 +128,7 @@ static inline int get_duration(AVIStream *ast, int len)
 {
     if (ast->sample_size)
         return len;
-    else if (ast->dshow_block_align > 1)
+    else if (ast->dshow_block_align)
         return (len + ast->dshow_block_align - 1) / ast->dshow_block_align;
     else
         return 1;
@@ -866,7 +866,8 @@ 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) {
+                    if (st->codec->codec_id == AV_CODEC_ID_AAC && ast->dshow_block_align <= 4 && ast->dshow_block_align ||
+                        st->codec->codec_id == AV_CODEC_ID_MP2 && 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;
                     }



More information about the ffmpeg-cvslog mailing list