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
path: root/src
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2012-01-24 05:45:08 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2012-01-24 05:47:54 +0400
commitee8adbe7015c9dfaa2f66279efdbd63e8e935ce8 (patch)
tree2f14fc13c4c1d31dbc182afcf093c1ffe29a7fa4 /src
parenta51ebd6831e839551255999f501dbf635c0f1943 (diff)
Fixes a few minor issues (no bit-stream change)
- Safer gain clamping for PLC - Makes opus_decoder_get_nb_samples() report an error on invalid ToC - Giving a free license to the text ofthe draft (not just the code)
Diffstat (limited to 'src')
-rw-r--r--src/opus_decoder.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/opus_decoder.c b/src/opus_decoder.c
index 97e3e968..ab79f427 100644
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -923,6 +923,10 @@ int opus_decoder_get_nb_samples(const OpusDecoder *dec,
{
int samples;
int count = opus_packet_get_nb_frames(packet, len);
+
+ if (count<0)
+ return count;
+
samples = count*opus_packet_get_samples_per_frame(packet, dec->Fs);
/* Can't have more than 120 ms */
if (samples*25 > dec->Fs*3)