From 385b37dca70b37f7cb77a2ca88925dd82c53d45b Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Thu, 31 Aug 2023 15:55:59 +0200 Subject: [PATCH] qemu-usb/webcam: close session after timeout and not before. On Windows guest with more than 1 vCPU, the packets seem to arrive and/or seem to be handled too late in the Webcam model. An intermediate state, to due the late packet, has been used to decide to close the Capture session too early. --- repos/libports/src/lib/qemu-usb/dev-webcam.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/libports/src/lib/qemu-usb/dev-webcam.c b/repos/libports/src/lib/qemu-usb/dev-webcam.c index a99d37b6df..fc97bf9fe9 100644 --- a/repos/libports/src/lib/qemu-usb/dev-webcam.c +++ b/repos/libports/src/lib/qemu-usb/dev-webcam.c @@ -527,8 +527,8 @@ static void webcam_timeout(void *opague) if (!state->delayed_packet) { unsigned const fps = 10000000u / formats[active_format()].interval; - /* capture off detection - after 1s or if in delay_packet state */ - if (state->delay_packet || (state->watchdog && state->watchdog >= fps)) { + /* capture off detection - after 1s */ + if (state->watchdog >= fps) { state->capture = false; state->delay_packet = false; capture_state_changed(state->capture);