process RTSP DESCRIBE response header
parent
7e685bb04a
commit
82af43f5fb
|
@ -366,6 +366,22 @@ int RtspThread::run()
|
|||
size_t sdpStart = response.find( endOfHeaders );
|
||||
if( sdpStart == std::string::npos )
|
||||
return( -1 );
|
||||
|
||||
std::string DescHeader = response.substr( 0,sdpStart );
|
||||
Debug( 1, "Processing DESCRIBE response header '%s'", DescHeader.c_str() );
|
||||
|
||||
lines = split( DescHeader, "\r\n" );
|
||||
for ( size_t i = 0; i < lines.size(); i++ )
|
||||
{
|
||||
// If the device sends us a url value for Content-Base in the response header, we should use that instead
|
||||
if ( ( lines[i].size() > 13 ) && ( lines[i].substr( 0, 13 ) == "Content-Base:" ) )
|
||||
{
|
||||
mUrl = trimSpaces( lines[i].substr( 13 ) );
|
||||
Info("Recieved new Content-Base in DESCRIBE reponse header. Updated device Url to: '%s'", mUrl.c_str() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sdpStart += endOfHeaders.length();
|
||||
|
||||
std::string sdp = response.substr( sdpStart );
|
||||
|
|
Loading…
Reference in New Issue