Skip to content

Commit

Permalink
Fix video playback on Windows 10
Browse files Browse the repository at this point in the history
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
  • Loading branch information
marcone committed Nov 7, 2024
1 parent 8c9c6c8 commit 1e6936a
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/usb_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1e6936a

Please sign in to comment.