fix freeze when closing USB connection during video capture

This commit is contained in:
Lephenixnoir 2023-02-02 19:15:34 +01:00
parent 92089cd208
commit d4639cfc24
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 14 additions and 8 deletions

View File

@ -106,16 +106,22 @@ static bool getkey_recording = false;
static void getkey_record_video_frame(int onscreen)
{
#ifdef FX9860G
if(dgray_enabled())
usb_fxlink_videocapture_gray(true);
else
usb_fxlink_videocapture(onscreen);
#endif
/* Auto stop when closing USB connection */
if(!usb_is_open()) {
dupdate_set_hook(GINT_CALL_NULL);
return;
}
#ifdef FXCG50
#ifdef FX9860G
if(dgray_enabled())
usb_fxlink_videocapture_gray(true);
else
usb_fxlink_videocapture(onscreen);
#endif
#endif
#ifdef FXCG50
usb_fxlink_videocapture(onscreen);
#endif
}
static bool getkey_global_shortcuts(key_event_t e)