summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authormalc <av1474@comtv.ru>2009-09-14 03:53:25 +0400
committermalc <av1474@comtv.ru>2009-09-14 03:55:42 +0400
commitacbf77133412c2f8231ba4805621cff91171f273 (patch)
treeb5d541161b9715c614497bc3af7368d90b77f10d /audio
parent616b211fea631848318178d17f84514d7b0d3bf0 (diff)
downloadqemu-acbf77133412c2f8231ba4805621cff91171f273.tar.gz
qemu-acbf77133412c2f8231ba4805621cff91171f273.tar.bz2
qemu-acbf77133412c2f8231ba4805621cff91171f273.zip
alsa: Use proper value when testing returned events in alsa_poll_handler
Signed-off-by: malc <av1474@comtv.ru>
Diffstat (limited to 'audio')
-rw-r--r--audio/alsaaudio.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
index b7031518f0..3fb6cbd41a 100644
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -37,6 +37,7 @@ struct pollhlp {
snd_pcm_t *handle;
struct pollfd *pfds;
int count;
+ int mask;
};
typedef struct ALSAVoiceOut {
@@ -200,7 +201,7 @@ static void alsa_poll_handler (void *opaque)
return;
}
- if (!(revents & POLLOUT)) {
+ if (!(revents & hlp->mask)) {
if (conf.verbose) {
dolog ("revents = %d\n", revents);
}
@@ -230,7 +231,7 @@ static void alsa_poll_handler (void *opaque)
}
}
-static int alsa_poll_helper (snd_pcm_t *handle, struct pollhlp *hlp)
+static int alsa_poll_helper (snd_pcm_t *handle, struct pollhlp *hlp, int mask)
{
int i, count, err;
struct pollfd *pfds;
@@ -287,6 +288,7 @@ static int alsa_poll_helper (snd_pcm_t *handle, struct pollhlp *hlp)
hlp->pfds = pfds;
hlp->count = count;
hlp->handle = handle;
+ hlp->mask = mask;
return 0;
}
@@ -294,14 +296,14 @@ static int alsa_poll_out (HWVoiceOut *hw)
{
ALSAVoiceOut *alsa = (ALSAVoiceOut *) hw;
- return alsa_poll_helper (alsa->handle, &alsa->pollhlp);
+ return alsa_poll_helper (alsa->handle, &alsa->pollhlp, POLLOUT);
}
static int alsa_poll_in (HWVoiceIn *hw)
{
ALSAVoiceIn *alsa = (ALSAVoiceIn *) hw;
- return alsa_poll_helper (alsa->handle, &alsa->pollhlp);
+ return alsa_poll_helper (alsa->handle, &alsa->pollhlp, POLLIN);
}
static int alsa_write (SWVoiceOut *sw, void *buf, int len)