[FFmpeg-cvslog] movenc.c: Force correct value for "Samples per packet" for pcm audio

Tim Nicholson git at videolan.org
Tue Oct 9 00:15:23 CEST 2012


ffmpeg | branch: master | Tim Nicholson <Tim.Nicholson at bbc.co.uk> | Fri Oct  5 09:33:12 2012 +0100| [a02762995bc5951d5d8178c8ca8b4769d4568d48] | committer: Michael Niedermayer

movenc.c: Force correct value for "Samples per packet" for pcm audio

Apple spec is for it to always be "1" for uncompressed audio.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/movenc.c            |    6 +++++-
 tests/ref/fate/acodec-pcm-s24be |    2 +-
 tests/ref/fate/acodec-pcm-s32be |    2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 2ec5d52..25dca33 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -709,7 +709,11 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track)
     }
 
     if(version == 1) { /* SoundDescription V1 extended info */
-        avio_wb32(pb, track->enc->frame_size); /* Samples per packet */
+        if (mov_pcm_le_gt16(track->enc->codec_id) ||
+            mov_pcm_be_gt16(track->enc->codec_id))
+            avio_wb32(pb, 1); /*  must be 1 for  uncompressed formats */
+        else
+            avio_wb32(pb, track->enc->frame_size); /* Samples per packet */
         avio_wb32(pb, track->sample_size / track->enc->channels); /* Bytes per packet */
         avio_wb32(pb, track->sample_size); /* Bytes per frame */
         avio_wb32(pb, 2); /* Bytes per sample */
diff --git a/tests/ref/fate/acodec-pcm-s24be b/tests/ref/fate/acodec-pcm-s24be
index 4d82b3e..3ebe02a 100644
--- a/tests/ref/fate/acodec-pcm-s24be
+++ b/tests/ref/fate/acodec-pcm-s24be
@@ -1,4 +1,4 @@
-cbf0bd68d21099335e197ae812834110 *tests/data/fate/acodec-pcm-s24be.mov
+f65a7ae3b70ca53ffa354b1e7ff3a33d *tests/data/fate/acodec-pcm-s24be.mov
 1588323 tests/data/fate/acodec-pcm-s24be.mov
 64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s24be.out.wav
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/tests/ref/fate/acodec-pcm-s32be b/tests/ref/fate/acodec-pcm-s32be
index bfd2797..9075083 100644
--- a/tests/ref/fate/acodec-pcm-s32be
+++ b/tests/ref/fate/acodec-pcm-s32be
@@ -1,4 +1,4 @@
-856b157d3ab505f0859b0de692e6a8bc *tests/data/fate/acodec-pcm-s32be.mov
+f9e16fafeefb2285e943f53133e9cfd5 *tests/data/fate/acodec-pcm-s32be.mov
 2117527 tests/data/fate/acodec-pcm-s32be.mov
 64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s32be.out.wav
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400



More information about the ffmpeg-cvslog mailing list