From fa19b264bcddcde3a15d7f62a6a8123935796ea7 Mon Sep 17 00:00:00 2001 From: Florian Zwoch Date: Tue, 6 Feb 2018 11:48:26 +0100 Subject: [PATCH] upon start: wait (best effort) for the SHM socket to appear befiore trying to read from it. --- gnome-screencast.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gnome-screencast.c b/gnome-screencast.c index 84192c7..d9f846a 100644 --- a/gnome-screencast.c +++ b/gnome-screencast.c @@ -215,6 +215,16 @@ static void start(data_t* data) data->frame_count = 0; + for (gint i = 0; i < 100; i++) + { + if (g_file_test(obs_data_get_string(data->settings, "shm_socket"), G_FILE_TEST_EXISTS) == TRUE) + { + break; + } + + g_usleep(10000); + } + gst_element_set_state(data->pipe, GST_STATE_PLAYING); }