Skip to content
Snippets Groups Projects
Commit f6bf6e51 authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos
Browse files

Set blkalign to maximum framesize to allow playback on WMP (see issue 2455 and issue 2446).

Originally committed as revision 26167 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent b3f5c21a
Branches
Tags
No related merge requests found
...@@ -373,6 +373,10 @@ int ff_put_wav_header(ByteIOContext *pb, AVCodecContext *enc) ...@@ -373,6 +373,10 @@ int ff_put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
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 || enc->codec_id == CODEC_ID_AC3) {
blkalign = enc->frame_size; //this is wrong, but it seems many demuxers do not work if this is set correctly 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; //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_ADPCM_G726) { // } else if (enc->codec_id == CODEC_ID_ADPCM_G726) { //
blkalign = 1; blkalign = 1;
} else if (enc->block_align != 0) { /* specified by the codec */ } else if (enc->block_align != 0) { /* specified by the codec */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment