Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@amazon.com>2023-04-14 07:55:46 +0300
committerJean-Marc Valin <jmvalin@amazon.com>2023-06-16 20:01:29 +0300
commitcd5b26887964c8f276fac9a1e30d6ef093fbe126 (patch)
tree69b56051962d913b75dc9c9e0394c93d2142ea03 /src/opus_decoder.c
parent0f0ee98386d82f257f35aa1700d90c83e3483d45 (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.c14
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)