2.1 regression: avcodec audio encoder divides by zero
This command:
vlc --no-sout-video music.mp3 --sout '#transcode{acodec=ulaw,rate=8000,channels=1}:display' -vv
results in:
[0xad233340] main input debug: Decoder buffering done in 585 ms
Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0xabaf9b40 (LWP 15088)]
0xadc0e960 in av_samples_get_buffer_size (linesize=linesize@entry=0x0,
nb_channels=nb_channels@entry=1, nb_samples=1024,
sample_fmt=sample_fmt@entry=AV_SAMPLE_FMT_S16, align=align@entry=0)
at /build/libav-YogfMx/libav-0.8.6/libavutil/samplefmt.c:108
108 /build/libav-YogfMx/libav-0.8.6/libavutil/samplefmt.c: Aucun fichier ou dossier de ce type.
(gdb) bt
[#0](https://code.videolan.org/videolan/vlc/-/issues/0) 0xadc0e960 in av_samples_get_buffer_size (linesize=linesize@entry=0x0,
nb_channels=nb_channels@entry=1, nb_samples=1024,
sample_fmt=sample_fmt@entry=AV_SAMPLE_FMT_S16, align=align@entry=0)
at /build/libav-YogfMx/libav-0.8.6/libavutil/samplefmt.c:108
[#1](https://code.videolan.org/videolan/vlc/-/issues/1) 0xae0fe7d5 in avcodec_fill_audio_frame (frame=0xb6f343a0, nb_channels=1,
sample_fmt=sample_fmt@entry=AV_SAMPLE_FMT_S16, buf=0xb6f2a540 "",
buf_size=2048, align=align@entry=0)
at /build/libav-YogfMx/libav-0.8.6/libavcodec/utils.c:259
[#2](https://code.videolan.org/videolan/vlc/-/issues/2) 0xaae4848d in EncodeAudio (p_enc=0xb6f004d8, p_aout_buf=0xb6f2a4e8)
at ../../../modules/codec/avcodec/encoder.c:1240
[#3](https://code.videolan.org/videolan/vlc/-/issues/3) 0xabc778a5 in transcode_audio_process (p_stream=p_stream@entry=0x80f6058,
id=id@entry=0xb6f224b0, in=0x0, in@entry=0x82337b0,
out=out@entry=0xabaf924c)
at ../../../modules/stream_out/transcode/audio.c:373
[#4](https://code.videolan.org/videolan/vlc/-/issues/4) 0xabc73b20 in Send (p_stream=0x80f6058, id=0xb6f224b0, p_buffer=0x82337b0)
at ../../../modules/stream_out/transcode/transcode.c:657
[#5](https://code.videolan.org/videolan/vlc/-/issues/5) 0xb7d89f9d in sout_InputSendBuffer (p_input=0xb6ff7730,
p_buffer=p_buffer@entry=0x82337b0)
at ../../src/stream_output/stream_output.c:233
[#6](https://code.videolan.org/videolan/vlc/-/issues/6) 0xb7d1825f in DecoderPlaySout (p_sout_block=0x82337b0, p_dec=0x8103228)
at ../../src/input/decoder.c:1672
[#7](https://code.videolan.org/videolan/vlc/-/issues/7) DecoderProcessSout (p_block=0x0, p_dec=0x8103228)
at ../../src/input/decoder.c:1794
[#8](https://code.videolan.org/videolan/vlc/-/issues/8) DecoderProcess (p_dec=p_dec@entry=0x8103228,
p_block=p_block@entry=0x82337b0) at ../../src/input/decoder.c:1995
[#9](https://code.videolan.org/videolan/vlc/-/issues/9) 0xb7d18d72 in DecoderThread (p_data=0x8103228)
at ../../src/input/decoder.c:939
[#10](https://code.videolan.org/videolan/vlc/-/issues/10) 0xb7f92cf1 in start_thread (arg=0xabaf9b40) at pthread_create.c:311
[#11](https://code.videolan.org/videolan/vlc/-/issues/11) 0xb7ec5f4e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:131
(Not sure why the native µ-law encoder is not used by the way.)