All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: David Henningsson <david.henningsson@canonical.com>
Cc: alsa-devel@alsa-project.org, hyperair@ubuntu.com
Subject: Re: [PATCH] a52: Ignore start request if we're already running
Date: Wed, 12 Nov 2014 16:14:45 +0100	[thread overview]
Message-ID: <s5hsiholaca.wl-tiwai@suse.de> (raw)
In-Reply-To: <1415804143-11519-1-git-send-email-david.henningsson@canonical.com>

At Wed, 12 Nov 2014 15:55:43 +0100,
David Henningsson wrote:
> 
> 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 <hyperair@ubuntu.com>
> Signed-off-by: David Henningsson <david.henningsson@canonical.com>

Thanks, applied.


Takashi

> ---
>  a52/pcm_a52.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> 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);
>  }
>  
> -- 
> 1.9.1
> 

      reply	other threads:[~2014-11-12 15:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12 14:55 [PATCH] a52: Ignore start request if we're already running David Henningsson
2014-11-12 15:14 ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hsiholaca.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=david.henningsson@canonical.com \
    --cc=hyperair@ubuntu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.