Permalink
Browse files

[AE][Alsa]: wait for alsa to be ready before probing it

  • Loading branch information...
Cory Fields
Cory Fields committed Oct 12, 2012
1 parent 28419ab commit df6d345e80ba2e11601c1d0f3bf28c5214a58aad
Showing with 7 additions and 7 deletions.
  1. +7 −7 xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
@@ -494,20 +494,20 @@ unsigned int CAESinkALSA::AddPackets(uint8_t *data, unsigned int frames, bool ha
int ret;
- ret = snd_pcm_avail(m_pcm);
- if (ret < 0)
- {
- HandleError("snd_pcm_avail", ret);
- ret = 0;
- }
-
if ((unsigned int)ret < frames)
{
ret = snd_pcm_wait(m_pcm, m_timeout);
if (ret < 0)
HandleError("snd_pcm_wait", ret);
}
+ ret = snd_pcm_avail(m_pcm);
+ if (ret < 0)
+ {
+ HandleError("snd_pcm_avail", ret);
+ ret = 0;
+ }
+
ret = snd_pcm_writei(m_pcm, (void*)data, frames);
if (ret < 0)
{

0 comments on commit df6d345

Please sign in to comment.