diff options
author | Jean-Marc Valin <jmvalin@amazon.com> | 2023-04-14 07:55:46 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2023-06-16 20:01:29 +0300 |
commit | cd5b26887964c8f276fac9a1e30d6ef093fbe126 (patch) | |
tree | 69b56051962d913b75dc9c9e0394c93d2142ea03 /src/opus_decoder.c | |
parent | 0f0ee98386d82f257f35aa1700d90c83e3483d45 (diff) |
DRED versioning in bitstream
Adding a 'D' byte to signal the DRED experiment, along with a version
number byte. This entire commit will be reverted once DRED is finalized
and given a non-experimental extension number.
Diffstat (limited to 'src/opus_decoder.c')
-rw-r--r-- | src/opus_decoder.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/opus_decoder.c b/src/opus_decoder.c index 555eed28..1341c79a 100644 --- a/src/opus_decoder.c +++ b/src/opus_decoder.c @@ -1112,9 +1112,17 @@ int opus_decoder_dred_input(OpusDecoder *st, const unsigned char *data, } } else if (id == 127) { - payload = data0+header_size; - payload_len = (data-data0)-header_size; - break; + const unsigned char *curr_payload; + opus_int32 curr_payload_len; + curr_payload = data0+header_size; + curr_payload_len = (data-data0)-header_size; + /* Check that temporary extension type and version match. + This check will be removed once extension is finalized. */ + if (curr_payload_len > 2 && curr_payload[0] == 'D' && curr_payload[1] == DRED_VERSION) { + payload = curr_payload+2; + payload_len = curr_payload_len-2; + break; + } } } if (payload != NULL) |