simplify and write correct values conforming to specs

Originally committed as revision 5640 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Baptiste Coudurier 2006-07-06 14:38:50 +00:00
parent 62a05b5b00
commit b7d9da100d

View File

@ -200,29 +200,17 @@ static int mov_write_stss_tag(ByteIOContext *pb, MOVTrack* track)
return updateSize (pb, pos);
}
static int mov_write_damr_tag(ByteIOContext *pb)
static int mov_write_amr_tag(ByteIOContext *pb, MOVTrack *track)
{
put_be32(pb, 0x11); /* size */
put_tag(pb, "damr");
if (track->mode == MODE_MOV) put_tag(pb, "samr");
else put_tag(pb, "damr");
put_tag(pb, "FFMP");
put_byte(pb, 0);
//put_be16(pb, 0x80); /* Mode set (all modes for AMR_NB) */
//put_be16(pb, 0xa); /* Mode change period (no restriction) */
put_be16(pb, 0x81ff); /* Mode set (all modes for AMR_NB) */
put_be16(pb, 1); /* Mode change period (no restriction) */
return 0x11;
}
static int mov_write_samr_tag(ByteIOContext *pb)
{
put_be32(pb, 0x11); /* size */
put_tag(pb, "samr");
put_tag(pb, "FFMP");
put_byte(pb, 1);
put_byte(pb, 0); /* decoder version */
put_be16(pb, 0x80); /* Mode set (all modes for AMR_NB) */
put_be16(pb, 0x5); /* Mode change period (no restriction) */
put_byte(pb, 0x00); /* Mode change period (no restriction) */
put_byte(pb, 0x01); /* Frames per sample */
return 0x11;
}
@ -322,7 +310,7 @@ static int mov_write_wave_tag(ByteIOContext *pb, MOVTrack* track)
track->enc->codec_id == CODEC_ID_PCM_S32LE) {
mov_write_enda_tag(pb);
} else if (track->enc->codec_id == CODEC_ID_AMR_NB) {
mov_write_samr_tag(pb);
mov_write_amr_tag(pb, track);
}
put_be32(pb, 8); /* size */
@ -404,7 +392,7 @@ static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack* track)
else if(track->enc->codec_id == CODEC_ID_AAC)
mov_write_esds_tag(pb, track);
else if(track->enc->codec_id == CODEC_ID_AMR_NB)
mov_write_damr_tag(pb);
mov_write_amr_tag(pb, track);
return updateSize (pb, pos);
}