From 4ad0747c785ebe48e80cf265db595cf8d17f5066 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 14 Jan 2017 20:48:55 +0100 Subject: [PATCH] output/alsa: explicitly mention all snd_pcm_state() enums I want a compiler warning when a new state needs to be considered here. --- src/output/plugins/AlsaOutputPlugin.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index d8168a7d1..83584930b 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -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;