summaryrefslogtreecommitdiff
path: root/libavformat/brstm.c
diff options
context:
space:
mode:
authorRodger Combs <rodger.combs@gmail.com>2015-06-20 05:01:26 -0500
committerPaul B Mahol <onemda@gmail.com>2015-06-21 10:32:13 +0000
commitd2ce10093e374709c5ea660d9b26f05043f1a6cd (patch)
tree9007e3acf74b9561eabee4eefead43e64d523353 /libavformat/brstm.c
parent9c9cf3956cd630035ea5b76c3f4fa6a82916e6ef (diff)
downloadffmpeg-d2ce10093e374709c5ea660d9b26f05043f1a6cd.tar.gz
lavf/brstm: handle a BFSTM endianness oddity
Diffstat (limited to 'libavformat/brstm.c')
-rw-r--r--libavformat/brstm.c12
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;