Commit bf2daf25 authored by michael's avatar michael

vbr requires version=1 and samplesize=0 per QT spec

untested, but if this doesnt work the issue is likely somewhere else, as iam just chaning the random nonsense we do to what the spec says should be done


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@5636 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent ff0aca4f
...@@ -353,9 +353,11 @@ static const CodecTag codec_movaudio_tags[] = { ...@@ -353,9 +353,11 @@ static const CodecTag codec_movaudio_tags[] = {
static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack* track) static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack* track)
{ {
offset_t pos = url_ftell(pb); offset_t pos = url_ftell(pb);
int vbr= track->enc->codec_id == CODEC_ID_AAC ||
track->enc->codec_id == CODEC_ID_MP3 ||
track->enc->codec_id == CODEC_ID_AMR_NB;
int version = track->mode == MODE_MOV && int version = track->mode == MODE_MOV &&
(track->enc->codec_id == CODEC_ID_AAC || (vbr ||
track->enc->codec_id == CODEC_ID_MP3 ||
track->enc->codec_id == CODEC_ID_PCM_S32LE || track->enc->codec_id == CODEC_ID_PCM_S32LE ||
track->enc->codec_id == CODEC_ID_PCM_S24LE); track->enc->codec_id == CODEC_ID_PCM_S24LE);
...@@ -375,9 +377,7 @@ static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack* track) ...@@ -375,9 +377,7 @@ static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack* track)
to be a good way to get number of bits of audio */ to be a good way to get number of bits of audio */
put_be16(pb, 0x10); /* Reserved */ put_be16(pb, 0x10); /* Reserved */
if(track->enc->codec_id == CODEC_ID_AAC || if(vbr) {
track->enc->codec_id == CODEC_ID_MP3 ||
track->enc->codec_id == CODEC_ID_AMR_NB) {
put_be16(pb, 0xfffe); /* compression ID (vbr)*/ put_be16(pb, 0xfffe); /* compression ID (vbr)*/
} else { } else {
put_be16(pb, 0); /* compression ID (= 0) */ put_be16(pb, 0); /* compression ID (= 0) */
...@@ -387,13 +387,10 @@ static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack* track) ...@@ -387,13 +387,10 @@ static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack* track)
put_be16(pb, 0); /* Reserved */ put_be16(pb, 0); /* Reserved */
if(version == 1) { /* SoundDescription V1 extended info */ if(version == 1) { /* SoundDescription V1 extended info */
/* Parameters tested on quicktime 6.5, 7 */ if (vbr)
if (track->enc->codec_id == CODEC_ID_MP3) track->sampleSize = 0;
track->sampleSize = 666;
if (track->enc->codec_id == CODEC_ID_AAC)
track->sampleSize = 2;
put_be32(pb, track->enc->frame_size); /* Samples per packet */ put_be32(pb, track->enc->frame_size); /* Samples per packet */
put_be32(pb, track->sampleSize / 2); /* Bytes per packet */ put_be32(pb, track->sampleSize / track->enc->channels); /* Bytes per packet */
put_be32(pb, track->sampleSize); /* Bytes per frame */ put_be32(pb, track->sampleSize); /* Bytes per frame */
put_be32(pb, 2); /* Bytes per sample */ put_be32(pb, 2); /* Bytes per sample */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment