]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Emit mdst and mden even if no rtptime is available. Use pcst and pcen tags to disting...
authorMike Brady <mikebrady@eircom.net>
Sun, 25 Oct 2015 13:50:23 +0000 (13:50 +0000)
committerMike Brady <mikebrady@eircom.net>
Sun, 25 Oct 2015 13:50:23 +0000 (13:50 +0000)
RELEASENOTES.md
rtsp.c

index 49061fbc817b4c6af08c108a39fa46c4ef9cb207..b82970bb90a1a82dde781491a8088aac1eab7943 100644 (file)
@@ -2,7 +2,9 @@ Version 2.7 -- Development Version
 ----
 **New Features**
 * Add a check to see if compilation is for a CYGWIN platform.
-* Add `rtptime` tags to metadata and picture information. Background: it seems that metadata and picture information for the same item, e.g. a track, are tagged with a timestamp called the `rtptime` -- if they refer to the same item, they will have the same `rtptime` tags. The update here is to add the `rtptime` value as data to the `mdst` and `mden` metadata items, which are  sent before ("MetaData STart") and after ("MetaData ENd") a metadata sequence. In addition, the same tags are now sent before and after a picture. By the way, the progress metadata (`prgr` for "PRoGRess"), which is sent just when a track starts, contains the same `rtptime` as its middle element.
+* Add `rtptime` tags to metadata and picture information and add two new metadata items to precede and follow the transmission of a picture. Background: it seems that metadata and picture information for the same item, e.g. a track, are normally tagged with a timestamp called the `rtptime`; if they refer to the same item, they will have the same `rtptime` tags. The update here is to add the `rtptime` value, if available, as data to the `mdst` and `mden` metadata items, which are  sent before ("MetaData STart") and after ("MetaData ENd") a metadata sequence.
+In addition, similar tags -- `pcst` ("PiCture STart") and `pcen` ("PiCture ENd") are now sent before and after a picture with the `rtptime` value, if available, sent as data.
+By the way, the progress metadata (`prgr` for "PRoGRess"), which is sent just when a track starts, contains the same `rtptime` as its middle element.
 
 
 Version 2.6 -- Stable Version
diff --git a/rtsp.c b/rtsp.c
index 16c19bbca63e1e8378d1aa2a83bdea6b58ed1b8e..503fb7ebf5ca67c672760e17497fad939d085623 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -857,8 +857,10 @@ static void handle_set_parameter_parameter(rtsp_conn_info *conn, rtsp_message *r
 //    'prgr' -- progress -- this is metadata from AirPlay consisting of RTP timestamps for the start
 //    of the current play sequence, the current play point and the end of the play sequence.
 //              I guess the timestamps wrap at 2^32.
-//    'mdst' -- a sequence of metadata is about to start
-//    'mden' -- a sequence of metadata has ended
+//    'mdst' -- a sequence of metadata is about to start; will have, as data, the rtptime associated with the metadata, if available
+//    'mden' -- a sequence of metadata has ended; will have, as data, the rtptime associated with the metadata, if available
+//    'pcst' -- a picture is about to be sent; will have, as data, the rtptime associated with the picture, if available
+//    'pcen' -- a picture has been sent; will have, as data, the rtptime associated with the metadata, if available
 //    'snam' -- A device -- e.g. "Joe's iPhone" -- has opened a play session. Specifically, it's the "X-Apple-Client-Name" string
 //    'snua' -- A "user agent" -- e.g. "iTunes/12..." -- has opened a play session. Specifically, it's the "User-Agent" string
 //    The next two two tokens are to facilitiate remote control of the source.
@@ -1145,10 +1147,16 @@ static void handle_set_parameter(rtsp_conn_info *conn, rtsp_message *req, rtsp_m
       if (p=NULL)
         debug(1,"Missing RTP-Time info for metadata");
       if (p)
-        send_metadata('ssnc', 'mdst', p+1, strlen(p+1), req, 1); // metadata starting   
+        send_metadata('ssnc', 'mdst', p+1, strlen(p+1), req, 1); // metadata starting
+      else
+        send_metadata('ssnc', 'mdst', NULL, 0, NULL, 0); // metadata starting, if rtptime is not available
+          
       handle_set_parameter_metadata(conn, req, resp);
+
       if (p)
         send_metadata('ssnc', 'mden', p+1, strlen(p+1), req, 1); // metadata ending
+      else
+        send_metadata('ssnc', 'mden', NULL, 0, NULL, 0); // metadata starting, if rtptime is not available
 
       
     } else if (!strncmp(ct, "image", 5)) {
@@ -1158,10 +1166,17 @@ static void handle_set_parameter(rtsp_conn_info *conn, rtsp_message *req, rtsp_m
       if (p=NULL)
         debug(1,"Missing RTP-Time info for picture item");
       if (p)
-        send_metadata('ssnc', 'mdst', p+1, strlen(p+1), req, 1); // metadata starting   
+        send_metadata('ssnc', 'pcst', p+1, strlen(p+1), req, 1); // picture starting   
+            else
+        send_metadata('ssnc', 'pcst', NULL, 0, NULL, 0); // picture starting, if rtptime is not available
+
       send_metadata('ssnc', 'PICT', req->content, req->contentlength, req, 1);
+
       if (p)
-        send_metadata('ssnc', 'mden', p+1, strlen(p+1), req, 1); // metadata ending
+        send_metadata('ssnc', 'pcen', p+1, strlen(p+1), req, 1); // picture ending
+      else
+        send_metadata('ssnc', 'pcen', NULL, 0, NULL, 0); // picture ending, if rtptime is not available
+
     } else
 #endif
         if (!strncmp(ct, "text/parameters", 15)) {