]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Fix compilation errors that accumulated with no --with-airplay-2 flag set.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Thu, 9 Sep 2021 10:24:23 +0000 (11:24 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Thu, 9 Sep 2021 10:24:23 +0000 (11:24 +0100)
player.h
rtsp.c

index 2badc274320b9bb2f4dcb4387666233137564808..2097dfddaedd54aa118fcad1fd9e9bb24fc8cac5 100644 (file)
--- 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 244ecd44254aad8a71db137a2ec98ce4c49f9158..dccb21a6e7f5c416d2070aac2ba3f7aa99fb4de9 100644 (file)
--- 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},