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>
This commit is contained in:
Volker Rümelin 2020-01-23 08:49:42 +01:00 committed by Gerd Hoffmann
parent 3e0c1bbab5
commit f03cd06814

View File

@ -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;
}
}
}