[PATCH] ogg123 hangs and takes 100% of the cpu when outputting to a pipe that has been closed.
My test is:
./ogg123 -d wav -f - test.ogg | less
then press q to quit less. Ogg123 will hang and start taking 100% of the CPU. The only way to stop it is "kill -9".
I have 2 patches that fix the problem:
Patch 1: stop-eating-my-cpu.patch:
This fixes the main hanging/cpu spinning problem.
Patch 2: dont-decode-after-pipe-closes.patch:
This adds a return value to buffer_submit_data() so that ogg123 knows when the buffer has shut down due to an error. Without this it doesn't hang, but it continues to decode the input even though there's no place to write it to.
I submitted this bug to Debian (bug #478991) and was advised to also submit it here for documentation.