[FFmpeg-devel] [PATCH]Fix little-endian audio in mov

Carl Eugen Hoyos cehoyos at ag.or.at
Sun May 15 22:42:41 CEST 2011


Hi!

Quicktime specification says that short littleEndian  is "TRUE" for little 
endian, "FALSE" for big endian. The samples on trac (that are all little 
endian) have: 0xab01, 0xbc01 and 0x5e01.
MPlayer (demux_mov.c 763) test is:
if (char2short(trak->stdata,52+20)) -> little endian

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 745768f..b03314b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -718,7 +718,7 @@ static int mov_read_enda(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         return 0;
     st = c->fc->streams[c->fc->nb_streams-1];
 
-    little_endian = avio_rb16(pb);
+    little_endian = avio_rb16(pb) & 0xF;
     av_dlog(c->fc, "enda %d\n", little_endian);
     if (little_endian == 1) {
         switch (st->codec->codec_id) {


More information about the ffmpeg-devel mailing list