[FFmpeg-cvslog] r26167 - trunk/libavformat/riff.c

Justin Ruggles justin.ruggles
Thu Dec 30 16:06:28 CET 2010


On 12/30/2010 09:21 AM, cehoyos wrote:

> Author: cehoyos
> Date: Thu Dec 30 15:21:14 2010
> New Revision: 26167
> 
> Log:
> Set blkalign to maximum framesize to allow playback on WMP (see issue 2455 and issue 2446).
> 
> Modified:
>    trunk/libavformat/riff.c
> 
> Modified: trunk/libavformat/riff.c
> ==============================================================================
> --- trunk/libavformat/riff.c	Thu Dec 30 14:34:31 2010	(r26166)
> +++ trunk/libavformat/riff.c	Thu Dec 30 15:21:14 2010	(r26167)
> @@ -373,6 +373,10 @@ int ff_put_wav_header(ByteIOContext *pb,
>      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 = 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) { //
>          blkalign = 1;
>      } else if (enc->block_align != 0) { /* specified by the codec */


I don't think this is quite correct.  enc->frame_size for AC-3 is 1536.
 There are cases where the frame size can be larger than 1536 bytes when
the bit rate is < 384kbps.  Try testing 32kHz @ 320kbps.

Maybe we should just always set blkalign to the maximum frame size
depending on the codec.  I don't know how large mp2 and mp3 can get...

-Justin



More information about the ffmpeg-cvslog mailing list