Skip to content

Commit

Permalink
changed: log strange alsa states on resume and flush to recover
Browse files Browse the repository at this point in the history
  • Loading branch information
Joakim Plate committed Feb 13, 2012
1 parent bdb8552 commit 1d32741
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion xbmc/cores/AudioRenderers/ALSADirectSound.cpp
Expand Up @@ -396,12 +396,20 @@ bool CALSADirectSound::Resume()
if(state == SND_PCM_STATE_PAUSED)
snd_pcm_pause(m_pPlayHandle,0);

if(state == SND_PCM_STATE_PREPARED)
else if(state == SND_PCM_STATE_PREPARED)
{
snd_pcm_sframes_t avail = snd_pcm_avail_update(m_pPlayHandle);
if(avail >= 0 && avail < (snd_pcm_sframes_t)m_uiBufferSize)
snd_pcm_start(m_pPlayHandle);
}
else if(state == SND_PCM_STATE_RUNNING)
{}
else
{
CLog::Log(LOGWARNING, "CALSADirectSound::Resume - unexpected device state %d flushing", state);
Flush();
snd_pcm_start(m_pPlayHandle);
}

m_bPause = false;

Expand Down

0 comments on commit 1d32741

Please sign in to comment.