chiark
/
gitweb
/
~mdw
/
disorder
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fb94c29
)
Further ALSA underrun fiddling.
author
Richard Kettlewell
<rjk@greenend.org.uk>
Mon, 24 Mar 2008 15:41:13 +0000
(15:41 +0000)
committer
Richard Kettlewell
<rjk@greenend.org.uk>
Mon, 24 Mar 2008 15:41:13 +0000
(15:41 +0000)
clients/playrtp-alsa.c
patch
|
blob
|
blame
|
history
diff --git
a/clients/playrtp-alsa.c
b/clients/playrtp-alsa.c
index f2336e4fc8e40053fb334b6bbf2ff6fc4adadf14..498b6e154994b1837920e83f63371d5fd882d67b 100644
(file)
--- a/
clients/playrtp-alsa.c
+++ b/
clients/playrtp-alsa.c
@@
-143,15
+143,15
@@
static int playrtp_alsa_writei(const void *s, size_t n) {
case -EPIPE:
error(0, "error calling snd_pcm_writei: %ld",
(long)frames_written);
case -EPIPE:
error(0, "error calling snd_pcm_writei: %ld",
(long)frames_written);
- if((err = snd_pcm_
prepare(pcm
)) < 0) {
- error(0, "error calling snd_pcm_
prepare
: %d", err);
+ if((err = snd_pcm_
recover(pcm, -EPIPE, 0
)) < 0) {
+ error(0, "error calling snd_pcm_
recover
: %d", err);
return -1;
}
frames_written = snd_pcm_writei(pcm, s, n / 2);
if(frames_written == -EAGAIN)
return 0;
else if(frames_written < 0) {
return -1;
}
frames_written = snd_pcm_writei(pcm, s, n / 2);
if(frames_written == -EAGAIN)
return 0;
else if(frames_written < 0) {
- error(0, "error
call
ing snd_pcm_writei: %ld",
+ error(0, "error
retry
ing snd_pcm_writei: %ld",
(long)frames_written);
return -1;
}
(long)frames_written);
return -1;
}
@@
-216,9
+216,13
@@
static void playrtp_alsa_disable(int hard_reset) {
if(hard_reset) {
if((err = snd_pcm_drop(pcm)))
fatal(0, "error calling snd_pcm_drop: %d", err);
if(hard_reset) {
if((err = snd_pcm_drop(pcm)))
fatal(0, "error calling snd_pcm_drop: %d", err);
- } else
- if((err = snd_pcm_drain(pcm)))
- fatal(0, "error calling snd_pcm_drain: %d", err);
+ } else {
+ if((err = snd_pcm_drain(pcm))) {
+ error(0, "error calling snd_pcm_drain: %d", err);
+ if((err = snd_pcm_drop(pcm)))
+ fatal(0, "error calling snd_pcm_drop: %d", err);
+ }
+ }
if((err = snd_pcm_nonblock(pcm, 1)))
fatal(0, "error calling snd_pcm_nonblock: %d", err);
playrtp_alsa_prepared = 0;
if((err = snd_pcm_nonblock(pcm, 1)))
fatal(0, "error calling snd_pcm_nonblock: %d", err);
playrtp_alsa_prepared = 0;