Update of /cvsroot/alsa/alsa-lib/src/pcm
In directory sc8-pr-cvs1:/tmp/cvs-serv11620
Modified Files:
pcm.c
Log Message:
check the current pcm status in snd_pcm_read/write_areas() if
snd_pcm_wait() returns an error. this will fix the bogus
return code of snd_pcm_readi/writei().
Index: pcm.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm.c,v
retrieving revision 1.252
retrieving revision 1.253
diff -u -r1.252 -r1.253
--- pcm.c 18 Mar 2003 20:37:48 -0000 1.252
+++ pcm.c 27 Mar 2003 09:10:22 -0000 1.253
@@ -6110,9 +6110,15 @@
}
err = snd_pcm_wait(pcm, -1);
- if (err < 0)
- break;
state = snd_pcm_state(pcm);
+ if (err < 0) {
+ /* check more precisely */
+ if (state == SND_PCM_STATE_XRUN)
+ err = -EPIPE;
+ else if (state == SND_PCM_STATE_SUSPENDED)
+ err = -ESTRPIPE;
+ break;
+ }
goto _again;
}
@@ -6183,9 +6189,15 @@
}
err = snd_pcm_wait(pcm, -1);
- if (err < 0)
- break;
state = snd_pcm_state(pcm);
+ if (err < 0) {
+ /* check more precisely */
+ if (state == SND_PCM_STATE_XRUN)
+ err = -EPIPE;
+ else if (state == SND_PCM_STATE_SUSPENDED)
+ err = -ESTRPIPE;
+ break;
+ }
goto _again;
}
-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog