[FFmpeg-devel] [PATCH] Fix audio has quality issues for certain audio codecs in AVI files.

gogostudio wangmeng_1985 at hotmail.com
Mon Jul 15 22:27:36 CEST 2013


---
 libavformat/avidec.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index a09bebd..9c454c3 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -687,7 +687,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) {
+                    if((st->codec->codec_id == AV_CODEC_ID_AAC ||
+                        st->codec->codec_id == AV_CODEC_ID_MP2 ||
+                        st->codec->codec_id == AV_CODEC_ID_MP3 ||
+                        st->codec->codec_id == AV_CODEC_ID_AC3) && 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;
                     }
-- 
1.8.3



More information about the ffmpeg-devel mailing list