From ed7bdd8647a3d0f534c2af0d244fc8744ff262a0 Mon Sep 17 00:00:00 2001 From: Alex Converse Date: Wed, 23 May 2012 11:32:52 -0700 Subject: [PATCH] movenc: Don't write the 'wave' atom or its child 'enda' for lpcm audio. It's left over from stsd v0. QuickTime 7 no longer writes 'wave' or 'enda' when 'lpcm' is the audio tag. --- libavformat/movenc.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 35c03ddfef..fa6e95771e 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -264,14 +264,6 @@ static int mov_write_extradata_tag(AVIOContext *pb, MOVTrack *track) return track->enc->extradata_size; } -static int mov_write_enda_tag(AVIOContext *pb) -{ - avio_wb32(pb, 10); - ffio_wfourcc(pb, "enda"); - avio_wb16(pb, 1); /* little endian */ - return 10; -} - static void put_descr(AVIOContext *pb, int tag, unsigned int size) { int i = 3; @@ -334,14 +326,6 @@ static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic return update_size(pb, pos); } -static int mov_pcm_le_gt16(enum CodecID codec_id) -{ - return codec_id == CODEC_ID_PCM_S24LE || - codec_id == CODEC_ID_PCM_S32LE || - codec_id == CODEC_ID_PCM_F32LE || - codec_id == CODEC_ID_PCM_F64LE; -} - static int mov_write_ms_tag(AVIOContext *pb, MOVTrack *track) { int64_t pos = avio_tell(pb); @@ -403,8 +387,6 @@ static int mov_write_wave_tag(AVIOContext *pb, MOVTrack *track) ffio_wfourcc(pb, "mp4a"); avio_wb32(pb, 0); mov_write_esds_tag(pb, track); - } else if (mov_pcm_le_gt16(track->enc->codec_id)) { - mov_write_enda_tag(pb); } else if (track->enc->codec_id == CODEC_ID_AMR_NB) { mov_write_amr_tag(pb, track); } else if (track->enc->codec_id == CODEC_ID_AC3) { @@ -641,8 +623,7 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track) track->enc->codec_id == CODEC_ID_AMR_NB || track->enc->codec_id == CODEC_ID_ALAC || track->enc->codec_id == CODEC_ID_ADPCM_MS || - track->enc->codec_id == CODEC_ID_ADPCM_IMA_WAV || - mov_pcm_le_gt16(track->enc->codec_id))) + track->enc->codec_id == CODEC_ID_ADPCM_IMA_WAV)) mov_write_wave_tag(pb, track); else if(track->tag == MKTAG('m','p','4','a')) mov_write_esds_tag(pb, track);