Commit 331b0d20 authored by Jean-Paul Saman's avatar Jean-Paul Saman

alsa: put pcm device back into running state after snd_pcm_recover() returned.

After recovery the pcm device can be in prepared state. To continue capturing data
the device must be put into running state again, hence the call to snd_pcm_start().
parent c9ed9487
...@@ -194,7 +194,23 @@ static void *Thread (void *data) ...@@ -194,7 +194,23 @@ static void *Thread (void *data)
{ {
msg_Warn (demux, "cannot read samples: %s", msg_Warn (demux, "cannot read samples: %s",
snd_strerror (frames)); snd_strerror (frames));
continue; snd_pcm_state_t state = snd_pcm_state (pcm);
switch (state)
{
case SND_PCM_STATE_PREPARED:
val = snd_pcm_start (pcm);
if (val < 0)
{
msg_Err (demux, "cannot prepare device: %s",
snd_strerror (val));
return NULL;
}
continue;
case SND_PCM_STATE_RUNNING:
continue;
default:
break;
}
} }
msg_Err (demux, "cannot recover record stream: %s", msg_Err (demux, "cannot recover record stream: %s",
snd_strerror (val)); snd_strerror (val));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment