From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Thu, 9 Sep 2021 10:24:23 +0000 (+0100) Subject: Fix compilation errors that accumulated with no --with-airplay-2 flag set. X-Git-Tag: 4.1-dev~4^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e123cf39acf0ccaf562d4a65af02909db424ce0;p=thirdparty%2Fshairport-sync.git Fix compilation errors that accumulated with no --with-airplay-2 flag set. --- diff --git a/player.h b/player.h index 2badc274..2097dfdd 100644 --- a/player.h +++ b/player.h @@ -101,15 +101,18 @@ typedef struct { audio_stream_type type; } stream_cfg; -#ifdef CONFIG_AIRPLAY_2 -typedef enum { ts_ntp, ts_ptp } timing_t; -typedef enum { ap_1, ap_2 } airplay_t; +// the following is used even when not built for AirPlay 2 typedef enum { unspecified_stream_category = 0, ptp_stream, ntp_stream, remote_control_stream } airplay_stream_c; // "c" for category + + +#ifdef CONFIG_AIRPLAY_2 +typedef enum { ts_ntp, ts_ptp } timing_t; +typedef enum { ap_1, ap_2 } airplay_t; typedef enum { realtime_stream, buffered_stream } airplay_stream_t; typedef struct { @@ -292,12 +295,13 @@ typedef struct { clock_status_t clock_status; + airplay_stream_c + airplay_stream_category; // is it a remote control stream or a normal "full service" stream? (will be unspecified if not build for AirPlay 2) + #ifdef CONFIG_AIRPLAY_2 char *airplay_gid; // UUID in the Bonjour advertisement -- if NULL, the group UUID is the same as // the pi UUID airplay_t airplay_type; // are we using AirPlay 1 or AirPlay 2 protocol on this connection? - airplay_stream_c - airplay_stream_category; // is it a remote control stream or a normal "full service" stream? airplay_stream_t airplay_stream_type; // is it realtime audio or buffered audio... timing_t timing_type; // are we using NTP or PTP on this connection? diff --git a/rtsp.c b/rtsp.c index 244ecd44..dccb21a6 100644 --- a/rtsp.c +++ b/rtsp.c @@ -199,7 +199,11 @@ static void pkString_make(char *str, size_t str_size, const char *device_id) { } #endif +#ifdef CONFIG_AIRPLAY_2 void build_bonjour_strings(rtsp_conn_info *conn) { +#else +void build_bonjour_strings(__attribute((unused)) rtsp_conn_info *conn) { +#endif int entry_number = 0; @@ -1767,6 +1771,12 @@ void handle_get(__attribute((unused)) rtsp_conn_info *conn, __attribute((unused) req->contentlength); resp->respcode = 500; } +void handle_post(__attribute((unused)) rtsp_conn_info *conn, __attribute((unused)) rtsp_message *req, + __attribute((unused)) rtsp_message *resp) { + debug(1, "Connection %d: POST %s Content-Length %d", conn->connection_number, req->path, + req->contentlength); + resp->respcode = 500; +} #endif #ifdef CONFIG_AIRPLAY_2 @@ -2871,6 +2881,8 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) resp->respcode = 200; } else if (conn->airplay_stream_category == remote_control_stream) { debug(1, "Connection %d: SETUP: Remote Control Stream received.", conn->connection_number); + debug_log_rtsp_message(1, "Remote Control Stream stream (second) message", req); + resp->respcode = 200; } else { debug(1, "Connection %d: SETUP: Stream received but no airplay category set. Nothing done.", @@ -4166,6 +4178,8 @@ static struct method_handler { void (*handler)(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp); // for AirPlay 1 only } method_handlers[] = {{"OPTIONS", handle_options}, + {"GET", handle_get}, + {"POST", handle_post}, {"ANNOUNCE", handle_announce}, {"FLUSH", handle_flush}, {"TEARDOWN", handle_teardown},