[FFmpeg-cvslog] lavf/riffenc: Set correct block align for mp2.

Juanjo git at videolan.org
Thu Jun 4 17:12:12 CEST 2015


ffmpeg | branch: master | Juanjo <pulento at users.sourceforge.net> | Thu Jun  4 14:47:24 2015 +0200| [a213e57cef82aefb57f1b2233f913081df153c7b] | committer: Michael Niedermayer

lavf/riffenc: Set correct block align for mp2.

Rounding by Michael.

Fixes ticket #4565.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a213e57cef82aefb57f1b2233f913081df153c7b
---

 libavformat/riffenc.c |    2 +-
 tests/ref/lavf/asf    |    2 +-
 tests/ref/lavf/avi    |    2 +-
 tests/ref/lavf/wtv    |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c
index d429df0..85c953f 100644
--- a/libavformat/riffenc.c
+++ b/libavformat/riffenc.c
@@ -103,7 +103,7 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc, int flags)
     }
 
     if (enc->codec_id == AV_CODEC_ID_MP2) {
-        blkalign = frame_size;
+        blkalign = (144 * enc->bit_rate - 1)/enc->sample_rate + 1;
     } else if (enc->codec_id == AV_CODEC_ID_MP3) {
         blkalign = 576 * (enc->sample_rate <= (24000 + 32000)/2 ? 1 : 2);
     } else if (enc->codec_id == AV_CODEC_ID_AC3) {
diff --git a/tests/ref/lavf/asf b/tests/ref/lavf/asf
index 400278c..911af72 100644
--- a/tests/ref/lavf/asf
+++ b/tests/ref/lavf/asf
@@ -1,3 +1,3 @@
-1a8716a0358b8123c02557dfdf6c259b *./tests/data/lavf/lavf.asf
+76f131a5426f0ba5fc7409d1a1bbfdd7 *./tests/data/lavf/lavf.asf
 333585 ./tests/data/lavf/lavf.asf
 ./tests/data/lavf/lavf.asf CRC=0xf6340a10
diff --git a/tests/ref/lavf/avi b/tests/ref/lavf/avi
index 8b14370..dfdb392 100644
--- a/tests/ref/lavf/avi
+++ b/tests/ref/lavf/avi
@@ -1,3 +1,3 @@
-07a29d329e7f07a4fd682145c3771995 *./tests/data/lavf/lavf.avi
+ab696052289d8dfea193e4cf94a94a6f *./tests/data/lavf/lavf.avi
 330814 ./tests/data/lavf/lavf.avi
 ./tests/data/lavf/lavf.avi CRC=0xec6c3c68
diff --git a/tests/ref/lavf/wtv b/tests/ref/lavf/wtv
index b0ae7d1..11c04c5 100644
--- a/tests/ref/lavf/wtv
+++ b/tests/ref/lavf/wtv
@@ -1,3 +1,3 @@
-b74b14ee41830aed90380bf6252dcfdb *./tests/data/lavf/lavf.wtv
+c5328b1c3e5fe70468c3f587c34ffd82 *./tests/data/lavf/lavf.wtv
 413696 ./tests/data/lavf/lavf.wtv
 ./tests/data/lavf/lavf.wtv CRC=0x71287e25



More information about the ffmpeg-cvslog mailing list