From 1e6936a432442a0fddb1ecfa178dd6e97d322434 Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Wed, 6 Nov 2024 17:00:47 -0800 Subject: [PATCH] Fix video playback on Windows 10 Doing a blocking read (even with count=0) when handling a cancel request from the host ends up blocking both the read in the request handler as well as a write in the thread that's being cancelled, blocking both threads indefinitely. Removing the read appears to fix the problem. Fixes #108 --- src/usb_gadget.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/usb_gadget.c b/src/usb_gadget.c index 6f7e5a7..87a446d 100644 --- a/src/usb_gadget.c +++ b/src/usb_gadget.c @@ -498,8 +498,6 @@ static void handle_setup_request(usb_gadget * ctx, struct usb_ctrlrequest* setup case MTP_REQ_CANCEL: PRINT_DEBUG("MTP_REQ_CANCEL !"); - status = read (ctx->usb_device, &status, 0); - mtp_context->cancel_req = 1; cnt = 0;