diff options
author | Rodger Combs <rodger.combs@gmail.com> | 2015-06-20 05:01:26 -0500 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2015-06-21 10:32:13 +0000 |
commit | d2ce10093e374709c5ea660d9b26f05043f1a6cd (patch) | |
tree | 9007e3acf74b9561eabee4eefead43e64d523353 | |
parent | 9c9cf3956cd630035ea5b76c3f4fa6a82916e6ef (diff) | |
download | ffmpeg-d2ce10093e374709c5ea660d9b26f05043f1a6cd.tar.gz |
lavf/brstm: handle a BFSTM endianness oddity
-rw-r--r-- | libavformat/brstm.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libavformat/brstm.c b/libavformat/brstm.c index 0014b48b31..45bdb72867 100644 --- a/libavformat/brstm.c +++ b/libavformat/brstm.c @@ -296,7 +296,17 @@ static int read_header(AVFormatContext *s) ret = AVERROR(ENOMEM); goto fail; } - avio_read(s->pb, b->adpc, asize); + if (bfstm && codec != AV_CODEC_ID_ADPCM_THP_LE) { + // Big-endian BFSTMs have little-endian SEEK tables + // for some strange reason. + int i; + for (i = 0; i < asize; i += 2) { + b->adpc[i+1] = avio_r8(s->pb); + b->adpc[i] = avio_r8(s->pb); + } + } else { + avio_read(s->pb, b->adpc, asize); + } avio_skip(s->pb, size - asize); } break; |