From 078d95bb7986d10607b9e0e53b9558f8e690dcad Mon Sep 17 00:00:00 2001 From: "F. Duncanh" Date: Fri, 22 Nov 2024 01:39:43 -0500 Subject: [PATCH] fix broken support for Ubuntu-20.04LTS --- lib/CMakeLists.txt | 14 ++++++++++---- renderers/video_renderer.c | 18 +++++++++++++----- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index f02a5e7..520c5bb 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -82,22 +82,28 @@ else() endif() # libplist -pkg_search_module(PLIST REQUIRED libplist-2.0) -if ( PLIST_FOUND ) - message( STATUS "found libplist-${PLIST_VERSION}" ) -endif() + if( APPLE ) # use static linking + pkg_search_module(PLIST REQUIRED libplist-2.0) find_library( LIBPLIST libplist-2.0.a REQUIRED ) message( STATUS "(Static linking) LIBPLIST " ${LIBPLIST} ) target_link_libraries ( airplay ${LIBPLIST} ) elseif( WIN32) +pkg_search_module(PLIST REQUIRED libplist-2.0) find_library( LIBPLIST ${PLIST_LIBRARIES} PATH ${PLIST_LIBDIR} ) target_link_libraries ( airplay ${LIBPLIST} ) else () + pkg_search_module(PLIST libplist>=2.0) + if(NOT PLIST_FOUND) + pkg_search_module(PLIST REQUIRED libplist-2.0) + endif() find_library( LIBPLIST ${PLIST_LIBRARIES} PATH ${PLIST_LIBDIR} ) target_link_libraries ( airplay PUBLIC ${LIBPLIST} ) endif() +if ( PLIST_FOUND ) + message( STATUS "found libplist-${PLIST_VERSION}" ) +endif() target_include_directories( airplay PRIVATE ${PLIST_INCLUDE_DIRS} ) #libcrypto diff --git a/renderers/video_renderer.c b/renderers/video_renderer.c index 8ec2075..3846a9b 100644 --- a/renderers/video_renderer.c +++ b/renderers/video_renderer.c @@ -206,11 +206,19 @@ void video_renderer_init(logger_t *render_logger, const char *server_name, video sync = false; } - if (!strcmp(renderer_type[i]->codec, h265)) { - g_string_replace (launch, (const gchar *) h264, (const gchar *) h265, 0); - } else { - g_string_replace (launch, (const gchar *) h265, (const gchar *) h264, 0); - } + if (!strcmp(renderer_type[i]->codec, h264)) { + char *pos = launch->str; + while ((pos = strstr(pos,h265))){ + pos +=3; + *pos = '4'; + } + } else if (!strcmp(renderer_type[i]->codec, h265)) { + char *pos = launch->str; + while ((pos = strstr(pos,h264))){ + pos +=3; + *pos = '5'; + } + } logger_log(logger, LOGGER_DEBUG, "GStreamer video pipeline %d:\n\"%s\"", i + 1, launch->str); renderer_type[i]->pipeline = gst_parse_launch(launch->str, &error);