[FFmpeg-devel] [PATCH] movenc: byteswap codec_tag in mov_write_ms_tag

Janne Grunau janne-ffmpeg
Thu Jan 27 17:36:49 CET 2011


based on Alex Converse's "Fix ADPCM MS in mov muxing" patch
---
 libavformat/movenc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 6061701..1279853 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -318,8 +318,8 @@ static int mov_write_ms_tag(ByteIOContext *pb, MOVTrack *track)
 {
     int64_t pos = url_ftell(pb);
     put_be32(pb, 0);
-    put_le32(pb, track->tag);
-    track->enc->codec_tag = track->tag >> 16;
+    put_le32(pb, track->tag); // store it byteswapped
+    track->enc->codec_tag = ((track->tag >> 8) & 0xFF00) + ((track->tag >> 24) & 0xFF);
     ff_put_wav_header(pb, track->enc);
     return updateSize(pb, pos);
 }
-- 
1.7.4.rc2




More information about the ffmpeg-devel mailing list