Only use automatic bandwidth detection when the user doesn't force bandwidth

Also fixes an issue with 40- and 60-ms frames using the repacketizer.
This commit is contained in:
Jean-Marc Valin 2012-12-21 13:09:43 -05:00
parent 2dd3fb9d59
commit 23fcd706fb

View file

@ -858,7 +858,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
if (st->Fs <= 8000 && st->bandwidth > OPUS_BANDWIDTH_NARROWBAND)
st->bandwidth = OPUS_BANDWIDTH_NARROWBAND;
#ifndef FIXED_POINT
if (st->detected_bandwidth)
if (st->detected_bandwidth && st->user_bandwidth == OPUS_AUTO)
{
st->bandwidth = IMIN(st->bandwidth, st->detected_bandwidth);
}