andrewrk / libsoundio

C library for cross-platform real-time audio input and output
http://libsound.io/
MIT License
1.92k stars 229 forks source link

alsa.c not handling SND_PCM_STATE_PRIVATE1 #195

Closed vlohacks closed 5 years ago

vlohacks commented 5 years ago

gcc 8.2.1 complains about the enum value SND_PCM_STATE_PRIVATE1 not being handled in the switch statements in instream_thread_run() and outstream_thread_run() functions.

Seems to be a bit of a shame from ALSA to add "Private - do not use" values to enums used by a public interface - especially how to deal with them if they occur: https://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#gga61ac499cb3701ce536d4d83725908860a5003a732bf308c84259933c64ab02f06

I just added

case SND_PCM_STATE_PRIVATE1:
    continue;

and hope it won't break anything. But there might be a better way to cope with this for someone who has a better insight in ALSAs internals.

andrewrk commented 5 years ago

fixed in #197, thank you @MisterDA