From 7bc54aed5316006b612fda011ce9b9ac25cf365a Mon Sep 17 00:00:00 2001 From: "F. Duncanh" Date: Fri, 10 Feb 2023 15:21:06 -0500 Subject: [PATCH] add gst_start_time --- uxplay.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/uxplay.cpp b/uxplay.cpp index c713895..df31991 100644 --- a/uxplay.cpp +++ b/uxplay.cpp @@ -57,6 +57,7 @@ #define VERSION "1.63" #define SECOND_IN_USECS 1000000 +#define SECOND_IN_NSECS 1000000000UL #define DEFAULT_NAME "UxPlay" #define DEFAULT_DEBUG_LOG false #define LOWEST_ALLOWED_PORT 1024 @@ -112,8 +113,7 @@ static int max_connections = 2; static unsigned short raop_port; static unsigned short airplay_port; static uint64_t audio_base_time, audio_start_time, video_base_time, video_start_time; - - +static uint64_t gst_start_time; /* 95 byte png file with a 1x1 white square (single pixel): placeholder for coverart*/ static const unsigned char empty_image[] = { @@ -1279,7 +1279,11 @@ int main (int argc, char *argv[]) { append_hostname(server_name); } - if (!gstreamer_init()) { + if (gstreamer_init()) { + struct timespec time; + clock_gettime(CLOCK_REALTIME, &time); + gst_start_time = ((uint64_t) time.tv_nsec) + (uint64_t) time.tv_sec * SECOND_IN_NSECS; + } else { LOGE ("stopping"); exit (1); }