From f03cd06814ab282196165808c01d4433773a6e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20R=C3=BCmelin?= Date: Thu, 23 Jan 2020 08:49:42 +0100 Subject: ossaudio: disable poll mode can't be reached MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Message-Id: <20200123074943.6699-8-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/ossaudio.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'audio/ossaudio.c') diff --git a/audio/ossaudio.c b/audio/ossaudio.c index 39a6fc0..f88d076 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; } } } -- cgit v1.1