[alsa-devel] [PATCH 5/6 v2] alsa-lib:pcm: check state before enter poll on timer.

Takashi Iwai tiwai at suse.de
Thu Jan 5 15:22:54 CET 2017


On Thu, 05 Jan 2017 14:29:43 +0100,
sutar.mounesh at gmail.com wrote:
> 
> From: Andreas Pape <apape at de.adit-jv.com>
> 
> To avoid the chances of timeout, we need to check the enter poll
> in state xrun.
> 
> Signed-off-by: Andreas Pape <apape at de.adit-jv.com>

Please give your sign-off, too, as you submitted the patch.

> +int snd_pcm_direct_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds,
> +				    unsigned int space)
> +{
> +	if (pcm->poll_fd < 0) {
> +		SNDMSG("poll_fd < 0");
> +		return -EIO;
> +	}
> +	if (space >= 1 && pfds) {
> +		pfds->fd = pcm->poll_fd;
> +		pfds->events = pcm->poll_events | POLLERR | POLLNVAL;
> +	} else {
> +		return 0;
> +	}
> +
> +	/*this will also evaluate slave state and enter xrun if necessary*/

Put spaces.


thanks,

Takashi


More information about the Alsa-devel mailing list