Permalink
Browse files

ae/alsa: fill buffer before starting the hardware

  • Loading branch information...
1 parent d903c18 commit d266446a5ead8b90dc7cb5eb0ee1dc0c6db6c9e4 Cory Fields committed Nov 20, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
@@ -489,9 +489,6 @@ unsigned int CAESinkALSA::AddPackets(uint8_t *data, unsigned int frames, bool ha
if (!m_pcm)
return 0;
- if (snd_pcm_state(m_pcm) == SND_PCM_STATE_PREPARED)
- snd_pcm_start(m_pcm);
-
int ret;
ret = snd_pcm_avail(m_pcm);
@@ -520,6 +517,9 @@ unsigned int CAESinkALSA::AddPackets(uint8_t *data, unsigned int frames, bool ha
}
}
+ if ( ret > 0 && snd_pcm_state(m_pcm) == SND_PCM_STATE_PREPARED)
+ snd_pcm_start(m_pcm);
+
return ret;
}

0 comments on commit d266446

Please sign in to comment.