Commit 4ad0747c authored by Max Kellermann's avatar Max Kellermann

output/alsa: explicitly mention all snd_pcm_state() enums

I want a compiler warning when a new state needs to be considered here.
parent c5cf6640
...@@ -803,6 +803,7 @@ AlsaOutput::Recover(int err) ...@@ -803,6 +803,7 @@ AlsaOutput::Recover(int err)
#if GCC_CHECK_VERSION(7,0) #if GCC_CHECK_VERSION(7,0)
[[fallthrough]]; [[fallthrough]];
#endif #endif
case SND_PCM_STATE_OPEN:
case SND_PCM_STATE_SETUP: case SND_PCM_STATE_SETUP:
case SND_PCM_STATE_XRUN: case SND_PCM_STATE_XRUN:
period_position = 0; period_position = 0;
...@@ -811,12 +812,11 @@ AlsaOutput::Recover(int err) ...@@ -811,12 +812,11 @@ AlsaOutput::Recover(int err)
case SND_PCM_STATE_DISCONNECTED: case SND_PCM_STATE_DISCONNECTED:
break; break;
/* this is no error, so just keep running */ /* this is no error, so just keep running */
case SND_PCM_STATE_PREPARED:
case SND_PCM_STATE_RUNNING: case SND_PCM_STATE_RUNNING:
case SND_PCM_STATE_DRAINING:
err = 0; err = 0;
break; break;
default:
/* unknown state, do nothing */
break;
} }
return err; return err;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment