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

github.com/mumble-voip/celt-0.7.0.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>2009-10-22 08:23:56 +0400
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>2009-10-22 08:23:56 +0400
commit7a047ea09676f92253b54c7e45be520a1fea52f1 (patch)
treed04148d1436342c7496783bf0a6edf1d699618f5
parent45f111058301102d1244a03b67110a8f0c45b89a (diff)
prevent busting at ridiculously low bit-rate VBR
-rw-r--r--libcelt/celt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libcelt/celt.c b/libcelt/celt.c
index 6f050f0..c7d1c09 100644
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -770,7 +770,9 @@ int celt_encode_float(CELTEncoder * restrict st, const celt_sig * pcm, celt_sig
celt_int32 vbr_bound, max_allowed;
vbr_bound = st->vbr_rate;
- max_allowed = (st->vbr_rate + vbr_bound - st->vbr_reservoir)>>(BITRES+3);
+ max_allowed = (st->vbr_rate + vbr_bound - st->vbr_reservoir)>>(BITRES+3);
+ if (max_allowed < 4)
+ max_allowed = 4;
if (max_allowed < nbCompressedBytes)
nbCompressedBytes = max_allowed;
}