]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Die if the NQPTP service is absent when trying to start a play session.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Mon, 28 Feb 2022 07:06:49 +0000 (18:06 +1100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Mon, 28 Feb 2022 07:06:49 +0000 (18:06 +1100)
rtsp.c

diff --git a/rtsp.c b/rtsp.c
index d43ea8e05a178c1cbcb13df06636ba2770106e6e..9eb88e4c02dc1d08b3c852c2934f4caa750356f3 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -2686,16 +2686,9 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp)
         // if it's a full service PTP stream, we get groupUUID, groupContainsGroupLeader and
         // timingPeerList
         if (conn->airplay_stream_category == ptp_stream) {
-          ptp_send_control_message_string("T"); // incidentally create the named SHM if necessary and remove all previous history
-          
-          if (ptp_shm_interface_open() == 0) {
-            debug(1,"shm interface opened successfully!");
-          } else {
-            warn("Unable to open the shm interface at SETUP!");  
-          }
-
-          
-          
+          if (ptp_shm_interface_open() != 0) // it should be open already, but just in case it isn't...
+            die("Can not access the NQPTP service. Has it stopped running?");
+          ptp_send_control_message_string("T"); // remove all previous history          
           debug_log_rtsp_message(2, "SETUP \"PTP\" message", req);
           plist_t groupUUID = plist_dict_get_item(messagePlist, "groupUUID");
           if (groupUUID) {
@@ -2800,7 +2793,6 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp)
 
             // debug(1,"initial timing peer command: \"%s\".", timing_list_message);
             ptp_send_control_message_string(timing_list_message);
-
             plist_dict_set_item(timingPeerInfoPlist, "Addresses", addresses);
             plist_dict_set_item(timingPeerInfoPlist, "ID", plist_new_string(conn->self_ip_string));
             plist_dict_set_item(setupResponsePlist, "timingPeerInfo", timingPeerInfoPlist);