mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-07-03 16:25:31 +00:00
Add friendly messages for certain error cases
This commit is contained in:
parent
5215271b60
commit
e2c2575efb
@ -27,7 +27,27 @@ pthread_t main_thread_id = 0;
|
|||||||
bool connection_debug;
|
bool connection_debug;
|
||||||
ConnListenerRumble rumble_handler = NULL;
|
ConnListenerRumble rumble_handler = NULL;
|
||||||
|
|
||||||
static void connection_terminated() {
|
static void connection_terminated(int errorCode) {
|
||||||
|
switch (errorCode) {
|
||||||
|
case ML_ERROR_GRACEFUL_TERMINATION:
|
||||||
|
break;
|
||||||
|
case ML_ERROR_NO_VIDEO_TRAFFIC:
|
||||||
|
printf("No video received from host. Check the host PC's firewall and port forwarding rules.\n");
|
||||||
|
break;
|
||||||
|
case ML_ERROR_NO_VIDEO_FRAME:
|
||||||
|
printf("Your network connection isn't performing well. Reduce your video bitrate setting or try a faster connection.\n");
|
||||||
|
break;
|
||||||
|
case ML_ERROR_UNEXPECTED_EARLY_TERMINATION:
|
||||||
|
printf("The connection was unexpectedly terminated by the host due to a video capture error. Make sure no DRM-protected content is playing on the host.\n");
|
||||||
|
break;
|
||||||
|
case ML_ERROR_PROTECTED_CONTENT:
|
||||||
|
printf("The connection was terminated by the host due to DRM-protected content. Close any DRM-protected content on the host and try again.\n");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
printf("Connection terminated with error: %d\n", errorCode);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (main_thread_id != 0)
|
if (main_thread_id != 0)
|
||||||
pthread_kill(main_thread_id, SIGTERM);
|
pthread_kill(main_thread_id, SIGTERM);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user