]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
In AirPlay 2 mode it can be selected by players
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Fri, 30 Apr 2021 13:23:31 +0000 (14:23 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Fri, 30 Apr 2021 13:23:31 +0000 (14:23 +0100)
rtsp.c

diff --git a/rtsp.c b/rtsp.c
index f107420a2ee977dede6c798a37cf7aec633215c4..13364690cb2ffc8e4655ad33e5438371db68fa9b 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -1409,16 +1409,18 @@ int msg_write_response(rtsp_conn_info *conn, rtsp_message *resp) {
       debug(1, "Attempted to write overlong RTSP packet 2");
       return -2;
     }
-    debug(1, "Content is \"%s\"", resp->content);
-    memcpy(p, resp->content, resp->contentlength);
-    pktfree -= resp->contentlength;
-    p += resp->contentlength;
   }
 
   n = snprintf(p, pktfree, "\r\n");
   pktfree -= n;
   p += n;
 
+  if (resp->contentlength) {
+    memcpy(p, resp->content, resp->contentlength);
+    pktfree -= resp->contentlength;
+    p += resp->contentlength;
+  }
+
   if (pktfree <= 1024) {
     debug(1, "Attempted to write overlong RTSP packet 3");
     return -3;