[Live-devel] [PATCH] Parse com.ses.streamID header

Julian Scheel julian at jusst.de
Sun Dec 13 23:51:29 PST 2015


Read satip specific com.ses.streamid header and update the baseurl using it.
The satip speficiation expects the streamid to be used as control url
(sat>ip protocol specification 1.2.2 p24ff) all stream arguments used for the
SETUP request are to be dropped once a streamid was retrieved.
This patch assumes that the url used for SETUP is not containing any slashes
after the host delimiter in baseurl, which is expected to be true for any
satip stream.

Signed-off-by: Julian Scheel <julian at jusst.de>
---
 liveMedia/RTSPClient.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/liveMedia/RTSPClient.cpp b/liveMedia/RTSPClient.cpp
index 73ab012..fc68042 100644
--- a/liveMedia/RTSPClient.cpp
+++ b/liveMedia/RTSPClient.cpp
@@ -1729,6 +1729,15 @@ void RTSPClient::handleResponseBytes(int newBytesRead) {
 	  // Note: we accept "Allow:" instead of "Public:", so that "OPTIONS" requests made to HTTP servers will work.
 	} else if (checkForHeader(lineStart, "Location:", 9, headerParamsStr)) {
 	  setBaseURL(headerParamsStr);
+	} else if (checkForHeader(lineStart, "com.ses.streamID:", 16, headerParamsStr)) {
+	  char *base = strrchr(fBaseURL, '/');
+	  char *newbase;
+	  if (base) {
+	    asprintf(&newbase, "%.*s/stream=%s", (int)(base - fBaseURL), fBaseURL,
+			    headerParamsStr + 1);
+	    setBaseURL(newbase);
+	    free(newbase);
+	  }
 	}
       }
       if (!reachedEndOfHeaders) break; // an error occurred
-- 
2.6.2



More information about the live-devel mailing list