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>
This commit is contained in:
Tim Nicholson
2012-10-05 09:33:12 +01:00
committed by Michael Niedermayer
parent 52dc18d414
commit a02762995b
3 changed files with 7 additions and 3 deletions

View File

@@ -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 */