--- a/sc2src/alsadirect.cpp
+++ b/sc2src/alsadirect.cpp
@@ -796,19 +796,13 @@
// Map the ALSA state to the audio eater state.
static AudioEater::AudioState audioState()
{
- snd_pcm_state_t pcm_state;
- AudioEater::AudioState state = AudioEater::AudioState::UNKNOWN;
+ AudioEater::AudioState state = AudioEater::AudioState::STOPPED;
if (pcm != nullptr) {
- pcm_state = snd_pcm_state(pcm);
+ snd_pcm_state_t pcm_state = snd_pcm_state(pcm);
LOGDEB("alsaEater: PCM state " << pcm_state << endl);
- switch (pcm_state) {
- case SND_PCM_STATE_RUNNING:
+ if (pcm_state == SND_PCM_STATE_RUNNING) {
state = AudioEater::AudioState::PLAYING;
- break;
- default:
- state = AudioEater::AudioState::STOPPED;
- break;
}
}