summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2006-04-16 09:23:27 +0000
committerPierre Ossman <ossman@cendio.se>2006-04-16 09:23:27 +0000
commite75cc68685c598deb71fdd0de4b68d43c595362d (patch)
treeb1e1f47dd609f3347019c1ebb2463727cab77ac5
parente8d9a5dbfb368ae0dc8a3d6aa497ee30ed30f454 (diff)
Fix ALSA fd handling to be compatible with blocking deferred events.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@724 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--src/modules/alsa-util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/alsa-util.c b/src/modules/alsa-util.c
index 683db6c0..2f9be07a 100644
--- a/src/modules/alsa-util.c
+++ b/src/modules/alsa-util.c
@@ -89,7 +89,6 @@ static void io_cb(pa_mainloop_api*a, pa_io_event* e, int fd, pa_io_event_flags_t
if (err < 0) {
pa_log_error(__FILE__": Unable to get poll revent: %s",
snd_strerror(err));
- a->defer_enable(fdl->defer, 0);
return;
}
@@ -99,6 +98,8 @@ static void io_cb(pa_mainloop_api*a, pa_io_event* e, int fd, pa_io_event_flags_t
else
snd_mixer_handle_events(fdl->mixer);
}
+
+ a->defer_enable(fdl->defer, 1);
}
static void defer_cb(pa_mainloop_api*a, pa_defer_event* e, void *userdata) {
@@ -108,6 +109,8 @@ static void defer_cb(pa_mainloop_api*a, pa_defer_event* e, void *userdata) {
assert(a && fdl && (fdl->pcm || fdl->mixer));
+ a->defer_enable(fdl->defer, 0);
+
if (fdl->pcm)
num_fds = snd_pcm_poll_descriptors_count(fdl->pcm);
else
@@ -133,7 +136,6 @@ static void defer_cb(pa_mainloop_api*a, pa_defer_event* e, void *userdata) {
if (err < 0) {
pa_log_error(__FILE__": Unable to get poll descriptors: %s",
snd_strerror(err));
- a->defer_enable(fdl->defer, 0);
return;
}