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.
This commit is contained in:
Alexander Boettcher 2023-08-31 15:55:59 +02:00 committed by Christian Helmuth
parent 9c32d53914
commit 385b37dca7

View File

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