summaryrefslogtreecommitdiffstats
path: root/pulse
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-07-16 15:15:42 +0200
committerTakashi Iwai <tiwai@suse.de>2008-07-16 15:48:06 +0200
commitcf23b804e022e6d9c0e1894fed887a735963a127 (patch)
tree5ecb5f415f0dce27de9174fc131af4cb88f25b5e /pulse
parent044d392628d33c71e2ac6411f4553bda7dc6ddff (diff)
pulse - Returns errors instead of assert()
Some sanity checks in pcm_pulse.c with assert() causes the program to abort unexpectedly when the pulseaudio daemon is dead. This is suboptimal. Examples: https://bugzilla.novell.com/show_bug.cgi?id=409532 Now fixed to return an error instead. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'pulse')
-rw-r--r--pulse/pcm_pulse.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c
index e4a6232..efff509 100644
--- a/pulse/pcm_pulse.c
+++ b/pulse/pcm_pulse.c
@@ -83,7 +83,10 @@ static int pulse_start(snd_pcm_ioplug_t *io)
goto finish;
o = pa_stream_cork(pcm->stream, 0, pulse_stream_success_cb, pcm->p);
- assert(o);
+ if (!o) {
+ err = -EIO;
+ goto finish;
+ }
err = pulse_wait_operation(pcm->p, o);
@@ -122,7 +125,10 @@ static int pulse_stop(snd_pcm_ioplug_t *io)
goto finish;
o = pa_stream_flush(pcm->stream, pulse_stream_success_cb, pcm->p);
- assert(o);
+ if (!o) {
+ err = -EIO;
+ goto finish;
+ }
err = pulse_wait_operation(pcm->p, o);
@@ -134,7 +140,10 @@ static int pulse_stop(snd_pcm_ioplug_t *io)
}
o = pa_stream_cork(pcm->stream, 1, pulse_stream_success_cb, pcm->p);
- assert(o);
+ if (!o) {
+ err = -EIO;
+ goto finish;
+ }
err = pulse_wait_operation(pcm->p, o);
@@ -169,7 +178,10 @@ int pulse_drain(snd_pcm_ioplug_t *io)
goto finish;
o = pa_stream_drain(pcm->stream, pulse_stream_success_cb, pcm->p);
- assert(o);
+ if (!o) {
+ err = -EIO;
+ goto finish;
+ }
err = pulse_wait_operation(pcm->p, o);