output/alsa: explicitly mention all snd_pcm_state() enums

I want a compiler warning when a new state needs to be considered
here.
This commit is contained in:
Max Kellermann 2017-01-14 20:48:55 +01:00
parent c5cf66402c
commit 4ad0747c78

View File

@ -803,6 +803,7 @@ AlsaOutput::Recover(int err)
#if GCC_CHECK_VERSION(7,0)
[[fallthrough]];
#endif
case SND_PCM_STATE_OPEN:
case SND_PCM_STATE_SETUP:
case SND_PCM_STATE_XRUN:
period_position = 0;
@ -811,12 +812,11 @@ AlsaOutput::Recover(int err)
case SND_PCM_STATE_DISCONNECTED:
break;
/* this is no error, so just keep running */
case SND_PCM_STATE_PREPARED:
case SND_PCM_STATE_RUNNING:
case SND_PCM_STATE_DRAINING:
err = 0;
break;
default:
/* unknown state, do nothing */
break;
}
return err;