Commit d2ce1009 authored by Rodger Combs's avatar Rodger Combs Committed by Paul B Mahol

lavf/brstm: handle a BFSTM endianness oddity

parent 9c9cf395
...@@ -296,7 +296,17 @@ static int read_header(AVFormatContext *s) ...@@ -296,7 +296,17 @@ static int read_header(AVFormatContext *s)
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto fail; 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); avio_skip(s->pb, size - asize);
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment