speex has no header in flv container, libspeexdec reports 'Invalid channel count' when decoding a flv file as the channels is not initialized. Reproduce this issue with: 1) ffmpeg -f lavfi -i anullsrc -ac 1 -ar 16000 -acodec libspeex test.flv 2) ffplay -acodec libspeex test.flv
Signed-off-by: huheng <[email protected]> --- libavcodec/libspeexdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c index 8c9e05e51d..bb8e1a7db9 100644 --- a/libavcodec/libspeexdec.c +++ b/libavcodec/libspeexdec.c @@ -43,7 +43,7 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx) LibSpeexContext *s = avctx->priv_data; const SpeexMode *mode; SpeexHeader *header = NULL; - int spx_mode, channels; + int spx_mode, channels = avctx->ch_layout.nb_channels; if (avctx->extradata && avctx->extradata_size >= 80) { header = speex_packet_to_header(avctx->extradata, -- 2.36.1 _______________________________________________ ffmpeg-devel mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
