From: David Henningsson Date: Wed, 12 Nov 2014 14:55:43 +0000 (+0100) Subject: a52: Ignore start request if we're already running X-Git-Tag: v1.0.29~1 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=a0693150dfd428fdd4df474efdc6b5e26a41ba21;p=alsa-plugins.git a52: Ignore start request if we're already running When trying to start a PCM that's already running, the result is EBADFD. We might have implicitly started the buffer by filling it up, so just ignore this request if we're already running. Reported-by: Chow Loong Jin Signed-off-by: David Henningsson Signed-off-by: Takashi Iwai --- diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c index b467ec8..59e25cb 100644 --- a/a52/pcm_a52.c +++ b/a52/pcm_a52.c @@ -482,6 +482,12 @@ static int a52_start(snd_pcm_ioplug_t *io) { struct a52_ctx *rec = io->private_data; + /* When trying to start a PCM that's already running, the result is + EBADFD. We might have implicitly started the buffer by filling it + up, so just ignore this request if we're already running. */ + if (snd_pcm_state(rec->slave) == SND_PCM_STATE_RUNNING) + return 0; + return snd_pcm_start(rec->slave); }