summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-02-21 22:31:07 +0100
committerPaul B Mahol <onemda@gmail.com>2020-02-23 18:17:29 +0100
commit9e0ddb5e80542d72059f9d817722a6e386ecc037 (patch)
tree718bb623411e990fead99d115fb4a066be6998d6
parentebc8806b9fcc8a2130773ddfd2f1678f78c24200 (diff)
avcodec/ac3_parser: recognize LE bitstream variant
-rw-r--r--libavcodec/ac3_parser.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/ac3_parser.c b/libavcodec/ac3_parser.c
index 1e203ae6ac..ba171653ef 100644
--- a/libavcodec/ac3_parser.c
+++ b/libavcodec/ac3_parser.c
@@ -201,6 +201,12 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
AC3HeaderInfo hdr;
GetBitContext gbc;
+ if (tmp.u8[1] == 0x77 && tmp.u8[2] == 0x0b) {
+ FFSWAP(uint8_t, tmp.u8[1], tmp.u8[2]);
+ FFSWAP(uint8_t, tmp.u8[3], tmp.u8[4]);
+ FFSWAP(uint8_t, tmp.u8[5], tmp.u8[6]);
+ }
+
init_get_bits(&gbc, tmp.u8+8-AC3_HEADER_SIZE, 54);
err = ff_ac3_parse_header(&gbc, &hdr);