* [FFmpeg-devel] [PATCH] avcodec/libspeexdec: initialize channels
@ 2022-07-16 6:08 huheng
2022-07-16 7:27 ` Paul B Mahol
0 siblings, 1 reply; 5+ messages in thread
From: huheng @ 2022-07-16 6:08 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: huheng
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 <heng.hu.1989@gmail.com>
---
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
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/libspeexdec: initialize channels
2022-07-16 6:08 [FFmpeg-devel] [PATCH] avcodec/libspeexdec: initialize channels huheng
@ 2022-07-16 7:27 ` Paul B Mahol
2022-07-16 10:33 ` hu heng
0 siblings, 1 reply; 5+ messages in thread
From: Paul B Mahol @ 2022-07-16 7:27 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: huheng
use native decoder
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/libspeexdec: initialize channels
2022-07-16 7:27 ` Paul B Mahol
@ 2022-07-16 10:33 ` hu heng
2022-07-16 10:50 ` Paul B Mahol
0 siblings, 1 reply; 5+ messages in thread
From: hu heng @ 2022-07-16 10:33 UTC (permalink / raw)
To: Paul B Mahol; +Cc: FFmpeg development discussions and patches
Thanks for your advice.
But native speex decoder also has its own issue when decoding speex packet
which contains multiple frames.
ffmpeg -i someaudio -ac 1 -ar 16000 -c:a libspeex -frames_per_packets 3 -f
flv xx.flv
ffplay xx.flv
native speed decoder only get the first frame of every packet as speex in
flv has no header.
so I prefer use libspeexdec as an alternative before the native speex
decoder issue is fixed and send this patch for libspeexdec.
Paul B Mahol <onemda@gmail.com> 于2022年7月16日周六 15:24写道:
> use native decoder
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/libspeexdec: initialize channels
2022-07-16 10:33 ` hu heng
@ 2022-07-16 10:50 ` Paul B Mahol
2022-07-16 10:54 ` Timo Rothenpieler
0 siblings, 1 reply; 5+ messages in thread
From: Paul B Mahol @ 2022-07-16 10:50 UTC (permalink / raw)
To: hu heng; +Cc: FFmpeg development discussions and patches
Please fix native decoder instead.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/libspeexdec: initialize channels
2022-07-16 10:50 ` Paul B Mahol
@ 2022-07-16 10:54 ` Timo Rothenpieler
0 siblings, 0 replies; 5+ messages in thread
From: Timo Rothenpieler @ 2022-07-16 10:54 UTC (permalink / raw)
To: ffmpeg-devel
On 16.07.2022 12:50, Paul B Mahol wrote:
> Please fix native decoder instead.
Both decoders should be fixed if they have issues decoding valid files.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-07-16 10:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-16 6:08 [FFmpeg-devel] [PATCH] avcodec/libspeexdec: initialize channels huheng
2022-07-16 7:27 ` Paul B Mahol
2022-07-16 10:33 ` hu heng
2022-07-16 10:50 ` Paul B Mahol
2022-07-16 10:54 ` Timo Rothenpieler
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git