Commit 488383af authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/avidec: add mp2 to the list of exceptions instead of generally...

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

Fixes Ticket4552
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b87dd7f8
...@@ -129,7 +129,7 @@ static inline int get_duration(AVIStream *ast, int len) ...@@ -129,7 +129,7 @@ static inline int get_duration(AVIStream *ast, int len)
{ {
if (ast->sample_size) if (ast->sample_size)
return len; 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; return (len + ast->dshow_block_align - 1) / ast->dshow_block_align;
else else
return 1; return 1;
...@@ -872,7 +872,8 @@ static int avi_read_header(AVFormatContext *s) ...@@ -872,7 +872,8 @@ static int avi_read_header(AVFormatContext *s)
st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_AMV; st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_AMV;
ast->dshow_block_align = 0; 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); av_log(s, AV_LOG_DEBUG, "overriding invalid dshow_block_align of %d\n", ast->dshow_block_align);
ast->dshow_block_align = 0; ast->dshow_block_align = 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment