relaunch server when display window is closed

This commit is contained in:
fduncanh
2021-08-05 19:47:32 -04:00
parent d34cae3328
commit 29f7ff3201
3 changed files with 10 additions and 5 deletions

View File

@@ -124,8 +124,9 @@ visible for screen-sharing.) Thanks to David Ventura
https://github.com/DavidVentura/UxPlay for the fix
and also for getting it into gstreamer-1.20.
4. uxplay now terminates correctly when the gstreamer display window is
closed, as well as when Ctrl-C is typed in the terminal window.
4. The AirPlay server now terminates correctly when the gstreamer display window is
closed, and is relaunched with the same settings to wait for a new connection.
The program uxplay terminates when Ctrl-C is typed in the terminal window.
5. In principle, multiple instances of uxplay can be run simultaneously
using the **-m** (generate random MAC address) option to give each a

View File

@@ -63,9 +63,9 @@ video_renderer_t *video_renderer_init(logger_t *logger, const char *server_name,
#endif
/* this call to g_set_application_name makes server_name appear in the display window title bar, */
/* (instead of the program name uxplay taken from (argv[0]) */
/* (instead of the program name uxplay taken from (argv[0]). It is only set one time. */
g_set_application_name(server_name);
if (!g_get_application_name()) g_set_application_name(server_name);
renderer = calloc(1, sizeof(video_renderer_t));
assert(renderer);

View File

@@ -286,13 +286,17 @@ int main (int argc, char *argv[]) {
parse_hw_addr(mac_address, server_hw_addr);
mac_address.clear();
relaunch:
if (start_server(server_hw_addr, server_name, display_size, tcp, udp,
videoflip,use_audio, debug_log) != 0) {
return 1;
}
running = true;
while (running) {
if ((video_renderer_listen(video_renderer))) break;
if ((video_renderer_listen(video_renderer))) {
stop_server();
goto relaunch;
}
}
LOGI("Stopping...");