shithub: opus

Download patch

ref: e959f0d5f23b9d3bc1cdb8e615782972b4f4fd62
parent: 4b1f45e407ad9923e64f2f1a5689290575899f9c
author: Jean-Marc Valin <[email protected]>
date: Wed Jul 6 21:23:11 EDT 2016

Prevents an invalid ToC to be generated at ridiculously low rate

--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -1065,7 +1065,7 @@
           bw=OPUS_BANDWIDTH_WIDEBAND;
        else if (tocmode==MODE_CELT_ONLY&&bw==OPUS_BANDWIDTH_MEDIUMBAND)
           bw=OPUS_BANDWIDTH_NARROWBAND;
-       else if (bw<=OPUS_BANDWIDTH_SUPERWIDEBAND)
+       else if (tocmode==MODE_HYBRID&&bw<=OPUS_BANDWIDTH_SUPERWIDEBAND)
           bw=OPUS_BANDWIDTH_SUPERWIDEBAND;
        data[0] = gen_toc(tocmode, frame_rate, bw, st->stream_channels);
        RESTORE_STACK;