* [PATCH] pcm, rate: hw_avail must not be negative before starting the stream
@ 2014-09-15 14:23 Alexander E. Patrakov
0 siblings, 0 replies; only message in thread
From: Alexander E. Patrakov @ 2014-09-15 14:23 UTC (permalink / raw)
To: alsa-devel; +Cc: tiwai, clemens, Alexander E. Patrakov
If it is, then it means most likely the driver problem, so we should
return error immediately instead.
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
---
As suggested by Takashi Iwai.
src/pcm/pcm_rate.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
index 736d558..c76db25 100644
--- a/src/pcm/pcm_rate.c
+++ b/src/pcm/pcm_rate.c
@@ -1069,7 +1069,10 @@ static int snd_pcm_rate_start(snd_pcm_t *pcm)
gettimestamp(&rate->trigger_tstamp, pcm->tstamp_type);
avail = snd_pcm_mmap_playback_hw_avail(rate->gen.slave);
- if (avail <= 0) {
+ if (avail < 0) /* can't happen on healthy drivers */
+ return -EBADFD;
+
+ if (avail == 0) {
/* postpone the trigger since we have no data committed yet */
rate->start_pending = 1;
return 0;
--
2.1.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-09-15 14:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-15 14:23 [PATCH] pcm, rate: hw_avail must not be negative before starting the stream Alexander E. Patrakov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).