OSDN Git Service

avformat/isom: lpcm in mov default to big endian
authorMark Himsley <mark@mdsh.com>
Fri, 1 Nov 2013 11:22:53 +0000 (11:22 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 1 Nov 2013 18:46:02 +0000 (19:46 +0100)
commit8b3964ecd1bfc7ac65ae91013b404beb7d2c875a
tree9eec25c9759159a27f393eb5d707db4de3eb15ce
parent1295377f0a9de3140330d4467347f10d03ec4169
avformat/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@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/isom.c