[FFmpeg-cvslog] isom: lpcm in mov default to big endian

Mark Himsley git at videolan.org
Tue Jun 3 02:49:37 CEST 2014


ffmpeg | branch: release/0.10 | Mark Himsley <mark at mdsh.com> | Fri Nov  1 11:22:53 2013 +0000| [b7b798a1afb1bfb1365b4ce67985351967c229d4] | committer: Reinhard Tartler

isom: lpcm in mov default to big endian

It is my understanding that "Unless otherwise stated, all data in a
QuickTime movie is stored in big-endian byte ordering" [1] in MOV files.

I have a couple of thousand files, which technically are invalid because
their sound sample description element 4CC is 'lpcm' but its version is
0 - and "Version 0 supports only uncompressed audio in raw ('raw ') or
twos-complement ('twos') format" [2]

Because isom.c only contains a mapping for 4CC 'lpcm' to
AV_CODEC_ID_PCM_S16LE, these files have their audio decoded as LE when
it is actually BE.

This commit adds AV_CODEC_ID_PCM_S16BE as the first match for 4CC 'lpcm'.

[1]
https://developer.apple.com/library/mac/documentation/quicktime/QTFF/qtff.pdf
page 21
[2]
https://developer.apple.com/library/mac/documentation/quicktime/QTFF/qtff.pdf
page 178

Reviewed-by: Yusuke Nakamura <muken.the.vfrmaniac at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b7b798a1afb1bfb1365b4ce67985351967c229d4
---

 libavformat/isom.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/isom.c b/libavformat/isom.c
index 347c992..e8f891c 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -256,6 +256,7 @@ const AVCodecTag codec_movaudio_tags[] = {
     { CODEC_ID_PCM_MULAW,       MKTAG('u', 'l', 'a', 'w') },
     { CODEC_ID_PCM_S16BE,       MKTAG('t', 'w', 'o', 's') },
     { CODEC_ID_PCM_S16LE,       MKTAG('s', 'o', 'w', 't') },
+    { CODEC_ID_PCM_S16BE,       MKTAG('l', 'p', 'c', 'm') },
     { CODEC_ID_PCM_S16LE,       MKTAG('l', 'p', 'c', 'm') },
     { CODEC_ID_PCM_S24BE,       MKTAG('i', 'n', '2', '4') },
     { CODEC_ID_PCM_S24LE,       MKTAG('i', 'n', '2', '4') },



More information about the ffmpeg-cvslog mailing list