aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorTim Nicholson <Tim.Nicholson@bbc.co.uk>2012-10-05 09:33:12 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-10-09 00:01:09 +0200
commita02762995bc5951d5d8178c8ca8b4769d4568d48 (patch)
tree342d6426f7f18a714fe8d59ad762dd9ee8e662c9 /libavformat/movenc.c
parent52dc18d414f4aa2c5a210edfb82cc1a99942ca3b (diff)
downloadffmpeg-a02762995bc5951d5d8178c8ca8b4769d4568d48.tar.gz
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@gmx.at>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 2ec5d520ad..25dca338ae 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 */