aboutsummaryrefslogtreecommitdiff
path: root/audio/ossaudio.c
diff options
context:
space:
mode:
authorVolker RĂ¼melin <vr_qemu@t-online.de>2020-01-23 08:49:42 +0100
committerGerd Hoffmann <kraxel@redhat.com>2020-01-31 08:48:57 +0100
commitf03cd06814ab282196165808c01d4433773a6e0f (patch)
treea08fbb386a059e432276b6c14f8e8e3ad46024e6 /audio/ossaudio.c
parent3e0c1bbab52d124231f56bdaa99b6d0e4a6e3fa6 (diff)
ossaudio: disable poll mode can't be reached
Currently there is no way to disable poll mode in oss_enable_out and oss_enable_in when it was enabled before. The enable code path always resets the poll mode state variable. Fixes: b027a538c6 "oss: Remove unused error handling of qemu_set_fd_handler" Signed-off-by: Volker RĂ¼melin <vr_qemu@t-online.de> Message-Id: <20200123074943.6699-8-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio/ossaudio.c')
-rw-r--r--audio/ossaudio.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index 39a6fc09e5..f88d076ec2 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -579,14 +579,12 @@ static void oss_enable_out(HWVoiceOut *hw, bool enable)
AudiodevOssPerDirectionOptions *opdo = oss->dev->u.oss.out;
if (enable) {
- bool poll_mode = opdo->try_poll;
+ hw->poll_mode = opdo->try_poll;
ldebug("enabling voice\n");
- if (poll_mode) {
+ if (hw->poll_mode) {
oss_poll_out(hw);
- poll_mode = 0;
}
- hw->poll_mode = poll_mode;
if (!oss->mmapped) {
return;
@@ -708,17 +706,15 @@ static void oss_enable_in(HWVoiceIn *hw, bool enable)
AudiodevOssPerDirectionOptions *opdo = oss->dev->u.oss.out;
if (enable) {
- bool poll_mode = opdo->try_poll;
+ hw->poll_mode = opdo->try_poll;
- if (poll_mode) {
+ if (hw->poll_mode) {
oss_poll_in(hw);
- poll_mode = 0;
}
- hw->poll_mode = poll_mode;
} else {
if (hw->poll_mode) {
- hw->poll_mode = 0;
qemu_set_fd_handler (oss->fd, NULL, NULL, NULL);
+ hw->poll_mode = 0;
}
}
}