diff --git a/inc/rtspconnectionclient.h b/inc/rtspconnectionclient.h index e1690c1..96d271f 100755 --- a/inc/rtspconnectionclient.h +++ b/inc/rtspconnectionclient.h @@ -130,8 +130,8 @@ class RTSPConnection void start(unsigned int delay = 0); void stop(); - std::string getUrl() { return m_url; } - int getRtpTransport() { return m_rtptransport; } + std::string getUrl() const { return m_url; } + int getRtpTransport() const { return m_rtptransport; } protected: TASK_CALLBACK(RTSPConnection,startCallback); diff --git a/src/rtspconnectionclient.cpp b/src/rtspconnectionclient.cpp index e53c479..9977978 100755 --- a/src/rtspconnectionclient.cpp +++ b/src/rtspconnectionclient.cpp @@ -65,6 +65,7 @@ void RTSPConnection::stop() void RTSPConnection::TaskstopCallback() { Medium::close(m_rtspClient); + m_rtspClient = NULL; } RTSPConnection::~RTSPConnection() @@ -79,20 +80,20 @@ int getHttpTunnelPort(int rtptransport, const char* rtspURL) if (rtptransport == RTSPConnection::RTPOVERHTTP) { std::string url = rtspURL; - const char * pattern = "://"; - std::size_t pos = url.find(pattern); - if (pos != std::string::npos) { - url.erase(0,pos+strlen(pattern)); - } - pos = url.find_first_of("/"); - if (pos != std::string::npos) { - url.erase(pos); - } - pos = url.find_first_of(":"); - if (pos != std::string::npos) { + const char * pattern = "://"; + std::size_t pos = url.find(pattern); + if (pos != std::string::npos) { + url.erase(0,pos+strlen(pattern)); + } + pos = url.find_first_of("/"); + if (pos != std::string::npos) { + url.erase(pos); + } + pos = url.find_first_of(":"); + if (pos != std::string::npos) { url.erase(0,pos+1); - httpTunnelPort = std::stoi(url); - } + httpTunnelPort = std::stoi(url); + } } return httpTunnelPort; }