From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH 5/6 v2] alsa-lib:pcm: check state before enter poll on timer. Date: Thu, 05 Jan 2017 15:22:54 +0100 Message-ID: References: <1483622983-1952-1-git-send-email-sutar.mounesh@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id DD584267733 for ; Thu, 5 Jan 2017 15:22:54 +0100 (CET) In-Reply-To: <1483622983-1952-1-git-send-email-sutar.mounesh@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: sutar.mounesh@gmail.com Cc: alsa-devel@alsa-project.org, Andreas Pape , mounesh_sutar@mentor.com List-Id: alsa-devel@alsa-project.org On Thu, 05 Jan 2017 14:29:43 +0100, sutar.mounesh@gmail.com wrote: > > From: Andreas Pape > > To avoid the chances of timeout, we need to check the enter poll > in state xrun. > > Signed-off-by: Andreas Pape 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