]> git.tuebingen.mpg.de Git - paraslash.git/commit
Teach writers to abort gracefully on early EOF.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 5 Sep 2021 18:16:59 +0000 (20:16 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Thu, 21 Oct 2021 17:53:06 +0000 (19:53 +0200)
commit53bbd5127f8bb9132aa9e252928d748f103d7e4e
tree0d6c782b3a7e456d9c6a04627a089553acf3b280
parentf1fe6d2729f2b0e7b48557d9cc5ddb4412a6bf22
Teach writers to abort gracefully on early EOF.

For very short streams it may happen that the receiver and decoder
unregister themselves from the buffer tree before the writer had a
chance to query the information from the decoder which it needs to
open the audio device. This leads to errors such as

Aug 25 14:24:51 schubert (5) get_btr_value: cmd sample_rate: Operation not supported
Aug 25 14:24:51 schubert (5) get_btr_value: cmd channels: Operation not supported
Aug 25 14:24:51 schubert (5) get_btr_value: cmd sample_format: Operation not supported
Aug 25 14:24:51 schubert (4) alsa_init: channels count not available: Invalid argument

This may happen with all receivers, audio formats and writers,
although it is most common with ogg streams.

This commit changes get_btr_sample_rate() and friends to return a
standard error code rather than assuming success. The alsa, ao and
oss writers are patched to check the return value and fail gracefully
if one of these functions fails.
alsa_write.c
ao_write.c
oss_write.c
write.h
write_common.c