jellyfin / jellyfin-mpv-shim

MPV Cast Client for Jellyfin
Other
1.5k stars 88 forks source link

Video player freezes when clicking "X" to close with `no-border` option in mpv.conf #340

Closed krozic closed 1 year ago

krozic commented 1 year ago

Describe the bug When no-border is used, the "X" to close the player causes the program to hang, requiring a forced closing of the video by using Task Manager to end the "run.exe" process.

To Reproduce Steps to reproduce the behavior:

  1. Include no-border in mpv.conf
  2. Restart
  3. Open jellyfin video
  4. Click "X" to close on the video window (the overlay decorations that appear like the OSC)

Expected behavior This should just close the video normally. In fact, right clicking on the tray icon and closing works fine. When the no-border option is not used, the actual "X" in the windows decoration also closes fine. I could not

Desktop (please complete the following information):

Error Messages

I click the "X" on the window right after "2023-05-13 18:58:25,934" is logged, however I don't notice anything out of the ordinary being logged.

2023-05-13 18:58:00,456 [   DEBUG] urllib3.connectionpool: http://192.168.30.20:8096 "POST /Sessions/Playing/Progress HTTP/1.1" 204 0
2023-05-13 18:58:05,549 [   DEBUG] urllib3.connectionpool: http://192.168.30.20:8096 "POST /Sessions/Playing/Progress HTTP/1.1" 204 0
2023-05-13 18:58:10,652 [   DEBUG] urllib3.connectionpool: http://192.168.30.20:8096 "POST /Sessions/Playing/Progress HTTP/1.1" 204 0
2023-05-13 18:58:12,792 [   DEBUG] websocket: Sending ping
2023-05-13 18:58:15,729 [   DEBUG] urllib3.connectionpool: http://192.168.30.20:8096 "POST /Sessions/Playing/Progress HTTP/1.1" 204 0
2023-05-13 18:58:20,828 [   DEBUG] urllib3.connectionpool: http://192.168.30.20:8096 "POST /Sessions/Playing/Progress HTTP/1.1" 204 0
2023-05-13 18:58:22,782 [   DEBUG] JELLYFIN.jellyfin_apiclient_python.ws_client: KeepAlive received from server.
2023-05-13 18:58:22,795 [   DEBUG] websocket: Sending ping
2023-05-13 18:58:25,934 [   DEBUG] urllib3.connectionpool: http://192.168.30.20:8096 "POST /Sessions/Playing/Progress HTTP/1.1" 204 0
2023-05-13 18:58:32,810 [   DEBUG] websocket: Sending ping
2023-05-13 18:58:42,816 [   DEBUG] websocket: Sending ping
iwalton3 commented 1 year ago

Quitting the player is unsupported as it kills the MPV process. Only stopping playback, which also closes the player window but keeps the process alive, is supported.

The reason the configuration seems to work for most usage is that I override the window close button and q button to stop playback.

krozic commented 1 year ago

Oh okay, that is fair enough. Based on the behavior I was thinking there was probably a "stop playback" command routed into the "close" action, but the overlayed buttons must be a different "close" action.

For anyone else in the unique position of looking to close the player with a mouse but preferring the no-border option, I added MBTN_MID stop to the "input.conf" file. This allows a middle click on the mouse to close the player.

Thanks for such a speedy response and a great app!