mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-12 02:04:58 +00:00
libspeexdec: If the channel count is not valid, decode as stereo.
When initialized as stereo, libspeex can decode either mono or stereo packets and will output stereo.
This commit is contained in:
parent
3b061c5e10
commit
29abb04e73
@ -70,9 +70,11 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx)
|
||||
}
|
||||
avctx->sample_rate = 8000 << spx_mode;
|
||||
|
||||
if (avctx->channels > 2) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Only stereo and mono are supported.\n");
|
||||
return AVERROR(EINVAL);
|
||||
if (avctx->channels < 1 || avctx->channels > 2) {
|
||||
/* libspeex can handle mono or stereo if initialized as stereo */
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid channel count: %d.\n"
|
||||
"Decoding as stereo.\n", avctx->channels);
|
||||
avctx->channels = 2;
|
||||
}
|
||||
|
||||
speex_bits_init(&s->bits);
|
||||
|
Loading…
Reference in New Issue
Block a user