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

Alex Converse alex.converse
Thu Jan 27 18:15:02 CET 2011


On Thu, Jan 27, 2011 at 8:36 AM, Janne Grunau <janne-ffmpeg at jannau.net> wrote:
> 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
>

Is this teston on a big endian system. I'll admit I didn't have access
to one and only tested mine on little endian?



More information about the ffmpeg-devel mailing list