comparison movenc.c @ 1125:6380964c7623 libavformat

fix aac in mov for ipod
author bcoudurier
date Mon, 19 Jun 2006 11:28:28 +0000
parents d3aff2c607f9
children 2eb2fd065a50
comparison
equal deleted inserted replaced
1124:d3aff2c607f9 1125:6380964c7623
321 put_be32(pb, 12); /* size */ 321 put_be32(pb, 12); /* size */
322 put_tag(pb, "frma"); 322 put_tag(pb, "frma");
323 put_le32(pb, track->tag); 323 put_le32(pb, track->tag);
324 324
325 if (track->enc->codec_id == CODEC_ID_AAC) { 325 if (track->enc->codec_id == CODEC_ID_AAC) {
326 /* useless atom needed by mplayer, ipod, not needed by quicktime */
327 put_be32(pb, 12); /* size */
328 put_tag(pb, "mp4a");
329 put_be32(pb, 0);
326 mov_write_esds_tag(pb, track); 330 mov_write_esds_tag(pb, track);
327 } else if (track->enc->codec_id == CODEC_ID_PCM_S24LE || 331 } else if (track->enc->codec_id == CODEC_ID_PCM_S24LE ||
328 track->enc->codec_id == CODEC_ID_PCM_S32LE) { 332 track->enc->codec_id == CODEC_ID_PCM_S32LE) {
329 mov_write_enda_tag(pb); 333 mov_write_enda_tag(pb);
330 } else if (track->enc->codec_id == CODEC_ID_AMR_NB) { 334 } else if (track->enc->codec_id == CODEC_ID_AMR_NB) {
392 put_be16(pb, track->timescale); /* Time scale */ 396 put_be16(pb, track->timescale); /* Time scale */
393 put_be16(pb, 0); /* Reserved */ 397 put_be16(pb, 0); /* Reserved */
394 398
395 if(version == 1) { 399 if(version == 1) {
396 /* SoundDescription V1 extended info */ 400 /* SoundDescription V1 extended info */
397 put_be32(pb, track->enc->frame_size); /* Samples per packet */ 401 put_be32(pb, track->enc->frame_size); /* Samples per packet */
398 put_be32(pb, track->sampleDuration); /* Bytes per frame */ 402 /* Parameters tested on quicktime 6.5, 7 */
399 put_be32(pb, 8); /* Bytes per sample */ 403 put_be32(pb, 1); /* Bytes per packet */
400 put_be32(pb, 2); 404 /* FIXME not correct */
405 /* 8 is the min value needed for in32 to work with quicktime 6.5 */
406 /* Value ignored by other codecs currently supported (others might need it) */
407 put_be32(pb, 8); /* Bytes per frame */
408 put_be32(pb, 2); /* Bytes per sample */
401 } 409 }
402 410
403 if(track->mode == MODE_MOV && 411 if(track->mode == MODE_MOV &&
404 (track->enc->codec_id == CODEC_ID_AAC || 412 (track->enc->codec_id == CODEC_ID_AAC ||
405 track->enc->codec_id == CODEC_ID_AMR_NB || 413 track->enc->codec_id == CODEC_ID_AMR_NB ||