movenc: byteswap codec_tag in mov_write_ms_tag
authorJanne Grunau <janne-ffmpeg@jannau.net>
Thu, 27 Jan 2011 16:26:20 +0000 (17:26 +0100)
committerJanne Grunau <janne-ffmpeg@jannau.net>
Fri, 28 Jan 2011 00:06:57 +0000 (01:06 +0100)
based on Alex Converse's "Fix ADPCM MS in mov muxing" patch

libavformat/movenc.c

index 6061701..0949d29 100644 (file)
@@ -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 = av_bswap16(track->tag >> 16);
     ff_put_wav_header(pb, track->enc);
     return updateSize(pb, pos);
 }