Skip to content

Commit

Permalink
avformat/avidec: add mp2 to the list of exceptions instead of general…
Browse files Browse the repository at this point in the history
…ly treating dshow_block_align==1 special

Fixes Ticket4552

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 488383a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed May 17, 2015
1 parent b58cbb0 commit af59176
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libavformat/avidec.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit af59176

Please sign in to comment.