diff options
author | Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> | 2009-10-22 08:23:56 +0400 |
---|---|---|
committer | Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> | 2009-10-22 08:23:56 +0400 |
commit | 7a047ea09676f92253b54c7e45be520a1fea52f1 (patch) | |
tree | d04148d1436342c7496783bf0a6edf1d699618f5 | |
parent | 45f111058301102d1244a03b67110a8f0c45b89a (diff) |
prevent busting at ridiculously low bit-rate VBR
-rw-r--r-- | libcelt/celt.c | 4 |
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; } |