diff options
author | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2011-01-06 13:30:32 +0000 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2011-01-06 13:30:32 +0000 |
commit | 504530bfbadfef05230179bccb0e733f032ac1a3 (patch) | |
tree | 8823e37cca0e7f6c231657fc2809ee9d13c5deb4 | |
parent | 79d482b108287b8d43adf6724deb2c6cd14e44d9 (diff) | |
download | ffmpeg-504530bfbadfef05230179bccb0e733f032ac1a3.tar.gz |
Set blkalign to 3840 (maximum bytes per frame) for AC-3 in avi.
Fixes playback for corner-cases like 32kHz 320kb.
Originally committed as revision 26242 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/riff.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libavformat/riff.c b/libavformat/riff.c index 551c3041a9..f81260a608 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -370,13 +370,11 @@ int ff_put_wav_header(ByteIOContext *pb, AVCodecContext *enc) av_log(enc, AV_LOG_WARNING, "requested bits_per_coded_sample (%d) and actually stored (%d) differ\n", enc->bits_per_coded_sample, bps); } - if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3 || enc->codec_id == CODEC_ID_AC3) { + if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3) { blkalign = enc->frame_size; //this is wrong, but it seems many demuxers do not work if this is set correctly //blkalign = 144 * enc->bit_rate/enc->sample_rate; - //For high bitrate AC-3, set blkalign to maximum bytes per frame value - //to allow playback on WMP and MPlayer - if (enc->bit_rate > 384000) - blkalign = 3840; + } else if (enc->codec_id == CODEC_ID_AC3) { + blkalign = 3840; //maximum bytes per frame } else if (enc->codec_id == CODEC_ID_ADPCM_G726) { // blkalign = 1; } else if (enc->block_align != 0) { /* specified by the codec */ |