Commit 97c45ff4 authored by Rafaël Carré's avatar Rafaël Carré

backports [22276] : fix live555 compilation

parent 24158b6c
......@@ -1078,8 +1078,10 @@ endif
ifdef HAVE_DARWIN_OS
patch -p0 < Patches/live-osx.patch
endif
patch -p0 < Patches/live-starttime.patch
patch -p0 < Patches/live-config.patch
(cd live/liveMedia/include; \
mv liveMedia_version.hh liveMedia_version.hh.bak; \
sed -e 's/.*LIVEMEDIA_LIBRARY_VERSION_INT.*/#define LIVEMEDIA_LIBRARY_VERSION_INT 9999999999/' liveMedia_version.hh.bak > liveMedia_version.hh )
patch -Np0 < Patches/live-config.patch
ifdef HAVE_UCLIBC
patch -p0 < Patches/live-noapps.patch
endif
......
diff -ruN live.orig/liveMedia/MediaSession.cpp live/liveMedia/MediaSession.cpp
--- live.orig/liveMedia/MediaSession.cpp 2007-01-17 21:44:26.000000000 +0100
+++ live/liveMedia/MediaSession.cpp 2007-01-22 22:17:54.000000000 +0100
@@ -61,7 +61,7 @@
MediaSession::MediaSession(UsageEnvironment& env)
: Medium(env),
fSubsessionsHead(NULL), fSubsessionsTail(NULL),
- fConnectionEndpointName(NULL), fMaxPlayEndTime(0.0f),
+ fConnectionEndpointName(NULL), fMaxPlayStartTime(0.0f), fMaxPlayEndTime(0.0f),
fScale(1.0f), fMediaSessionType(NULL), fSessionName(NULL), fSessionDescription(NULL) {
#ifdef SUPPORT_REAL_RTSP
RealInitSDPAttributes(this);
@@ -348,8 +348,8 @@
return parseSuccess;
}
-static Boolean parseRangeAttribute(char const* sdpLine, float& endTime) {
- return sscanf(sdpLine, "a=range: npt = %*g - %g", &endTime) == 1;
+static Boolean parseRangeAttribute(char const* sdpLine, float& startTime, float& endTime) {
+ return sscanf(sdpLine, "a=range: npt = %g - %g", &startTime, &endTime) == 2;
}
Boolean MediaSession::parseSDPAttribute_range(char const* sdpLine) {
@@ -357,9 +357,13 @@
// (Later handle other kinds of "a=range" attributes also???#####)
Boolean parseSuccess = False;
+ float playStartTime;
float playEndTime;
- if (parseRangeAttribute(sdpLine, playEndTime)) {
+ if (parseRangeAttribute(sdpLine, playStartTime, playEndTime)) {
parseSuccess = True;
+ if (playStartTime != fMaxPlayStartTime && playStartTime >= 0.0f) {
+ fMaxPlayStartTime = playStartTime;
+ }
if (playEndTime > fMaxPlayEndTime) {
fMaxPlayEndTime = playEndTime;
}
@@ -526,7 +530,7 @@
fSizelength(0), fStreamstateindication(0), fStreamtype(0),
fCpresent(False), fRandomaccessindication(False),
fConfig(NULL), fMode(NULL), fSpropParameterSets(NULL),
- fPlayEndTime(0.0),
+ fPlayStartTime(0.0), fPlayEndTime(0.0),
fVideoWidth(0), fVideoHeight(0), fVideoFPS(0), fNumChannels(1), fScale(1.0f),
fRTPSocket(NULL), fRTCPSocket(NULL),
fRTPSource(NULL), fRTCPInstance(NULL), fReadSource(NULL) {
@@ -548,6 +552,12 @@
#endif
}
+float MediaSubsession::playStartTime() const {
+ if (fPlayStartTime > 0) return fPlayStartTime;
+
+ return fParent.playStartTime();
+}
+
float MediaSubsession::playEndTime() const {
if (fPlayEndTime > 0) return fPlayEndTime;
@@ -967,9 +977,16 @@
// (Later handle other kinds of "a=range" attributes also???#####)
Boolean parseSuccess = False;
+ float playStartTime;
float playEndTime;
- if (parseRangeAttribute(sdpLine, playEndTime)) {
+ if (parseRangeAttribute(sdpLine, playStartTime, playEndTime)) {
parseSuccess = True;
+ if (playStartTime != fPlayStartTime && playStartTime >= 0.0f ) {
+ fPlayStartTime = playStartTime;
+ if (playStartTime != fParent.playStartTime()) {
+ fParent.playStartTime() = playStartTime;
+ }
+ }
if (playEndTime > fPlayEndTime) {
fPlayEndTime = playEndTime;
if (playEndTime > fParent.playEndTime()) {
diff -ruN live.orig/liveMedia/RTSPClient.cpp live/liveMedia/RTSPClient.cpp
--- live.orig/liveMedia/RTSPClient.cpp 2007-01-22 22:17:46.000000000 +0100
+++ live/liveMedia/RTSPClient.cpp 2007-01-22 22:21:12.000000000 +0100
@@ -1128,7 +1128,8 @@
nextLineStart = getLine(lineStart);
- if (parseScaleHeader(lineStart, session.scale())) break;
+ if( parseScaleHeader(lineStart, session.scale())) continue;
+ if( parseRangeHeader(lineStart, session.playStartTime(), session.playEndTime()) ) continue;
}
if (fTCPStreamIdCount == 0) { // we're not receiving RTP-over-TCP
@@ -1229,6 +1230,7 @@
continue;
}
if (parseScaleHeader(lineStart, subsession.scale())) continue;
+ //if (parseRangeHeader(lineStart, subsession.playStartTime(), subsession.playEndTime())) continue;
}
delete[] cmd;
@@ -2287,6 +2289,14 @@
return radix_safe_sscanf(line, "%f", &scale) == 1;
}
+Boolean RTSPClient::parseRangeHeader(char const* line, float& start, float& end) {
+ if (_strncasecmp(line, "Range: ", 7) != 0) return False;
+ line += 7;
+
+ /* "npt=start-" is also valid */
+ return radix_safe_sscanf(line, "npt = %f - %f", &start, &end) >= 1;
+}
+
Boolean RTSPClient::parseGetParameterHeader(char const* line,
const char* param,
char*& value) {
diff -ruN live.orig/liveMedia/include/MediaSession.hh live/liveMedia/include/MediaSession.hh
--- live.orig/liveMedia/include/MediaSession.hh 2007-01-17 21:44:26.000000000 +0100
+++ live/liveMedia/include/MediaSession.hh 2007-01-22 22:20:30.000000000 +0100
@@ -39,6 +39,7 @@
MediaSession*& resultSession);
Boolean hasSubsessions() const { return fSubsessionsHead != NULL; }
+ float& playStartTime() { return fMaxPlayStartTime; }
float& playEndTime() { return fMaxPlayEndTime; }
char* connectionEndpointName() const { return fConnectionEndpointName; }
char const* CNAME() const { return fCNAME; }
@@ -97,6 +98,7 @@
// Fields set from a SDP description:
char* fConnectionEndpointName;
+ float fMaxPlayStartTime;
float fMaxPlayEndTime;
struct in_addr fSourceFilterAddr; // used for SSM
float fScale; // set from a RTSP "Scale:" header
@@ -147,6 +149,7 @@
// This is the source that client sinks read from. It is usually
// (but not necessarily) the same as "rtpSource()"
+ float playStartTime() const;
float playEndTime() const;
Boolean initiate(int useSpecialRTPoffset = -1);
@@ -268,6 +271,7 @@
Boolean fCpresent, fRandomaccessindication;
char *fConfig, *fMode, *fSpropParameterSets;
+ float fPlayStartTime;
float fPlayEndTime;
unsigned short fVideoWidth, fVideoHeight;
// screen dimensions (set by an optional a=x-dimensions: <w>,<h> line)
diff -ruN live.orig/liveMedia/include/RTSPClient.hh live/liveMedia/include/RTSPClient.hh
--- live.orig/liveMedia/include/RTSPClient.hh 2007-01-17 21:44:26.000000000 +0100
+++ live/liveMedia/include/RTSPClient.hh 2007-01-22 22:17:54.000000000 +0100
@@ -185,6 +185,7 @@
Boolean parseRTPInfoHeader(char const* line, unsigned& trackId,
u_int16_t& seqNum, u_int32_t& timestamp);
Boolean parseScaleHeader(char const* line, float& scale);
+ Boolean parseRangeHeader(char const* line, float& start, float& end);
Boolean parseGetParameterHeader(char const* line,
const char* param,
char*& value);
--- live/liveMedia/include/liveMedia_version.hh.orig 2007-05-24 22:44:37.000000000 +0200
+++ live/liveMedia/include/liveMedia_version.hh 2007-05-27 14:16:11.000000000 +0200
@@ -5,6 +5,6 @@
#define _LIVEMEDIA_VERSION_HH
#define LIVEMEDIA_LIBRARY_VERSION_STRING "2007.05.24"
-#define LIVEMEDIA_LIBRARY_VERSION_INT 1179964800
+#define LIVEMEDIA_LIBRARY_VERSION_INT 9999999999
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment