From 3ec4bf52e1757f61c2da32818ab123a3f05ebb11 Mon Sep 17 00:00:00 2001 From: arne Date: Tue, 13 Apr 2021 18:36:48 +0200 Subject: [PATCH] avahi service publishing cleanup & appveyor --- appveyor.yml | 2 +- sunshine/publish.cpp | 9 ++++----- sunshine/publish.h | 3 --- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 2bbc9b2c..2d2c6bb9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,7 +9,7 @@ environment: install: - sh: sudo apt update - - sh: sudo apt install -y build-essential cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev + - sh: sudo apt install -y build-essential cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev libavahi-client-dev - cmd: C:\msys64\usr\bin\bash -lc "pacman --needed --noconfirm -S mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-opus mingw-w64-x86_64-x265 mingw-w64-x86_64-boost git yasm nasm diffutils make" before_build: diff --git a/sunshine/publish.cpp b/sunshine/publish.cpp index 23a0a04f..6494919e 100644 --- a/sunshine/publish.cpp +++ b/sunshine/publish.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include "publish.h" #include "nvhttp.h" @@ -105,15 +104,15 @@ void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED vo void start(std::shared_ptr shutdown_event) { AvahiClient *client = NULL; - int error; + int avhi_error; if (!(simple_poll = avahi_simple_poll_new())) { - fprintf(stderr, "Failed to create simple poll object.\n"); + BOOST_LOG(error) << "Failed to create simple poll object."; return; } name = avahi_strdup(SERVICE_NAME); - client = avahi_client_new(avahi_simple_poll_get(simple_poll), AvahiClientFlags(0), client_callback, NULL, &error); + client = avahi_client_new(avahi_simple_poll_get(simple_poll), AvahiClientFlags(0), client_callback, NULL, &avhi_error); if (!client) { - fprintf(stderr, "Failed to create client: %s\n", avahi_strerror(error)); + BOOST_LOG(error) << "Failed to create client: " << avahi_strerror(avhi_error); avahi_simple_poll_free(simple_poll); return; } diff --git a/sunshine/publish.h b/sunshine/publish.h index db29fdb6..ed84031c 100644 --- a/sunshine/publish.h +++ b/sunshine/publish.h @@ -1,9 +1,6 @@ #ifndef SUNSHINE_PUBLISH_H #define SUNSHINE_PUBLISH_H -#include -#include - #include "thread_safe.h" #define SERVICE_NAME "Sunshine"