riff: Pass block_align to estimate frame duration
authornu774 <honeycomb77@gmail.com>
Fri, 16 May 2014 11:25:46 +0000 (20:25 +0900)
committerLuca Barbato <lu_zero@gentoo.org>
Sat, 17 May 2014 13:24:20 +0000 (15:24 +0200)
Fix incorrect wSamplesPerBlock(=0) written for ADPCM_IMA_WAV

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavformat/riffenc.c

index 8479d9d..fe92bc5 100644 (file)
@@ -62,7 +62,7 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
     /* We use the known constant frame size for the codec if known, otherwise
      * fall back on using AVCodecContext.frame_size, which is not as reliable
      * for indicating packet duration. */
-    frame_size = av_get_audio_frame_duration(enc, 0);
+    frame_size = av_get_audio_frame_duration(enc, enc->block_align);
     if (!frame_size)
         frame_size = enc->frame_size;