From a9109d750cd86b800418a61c878ae77bc794d576 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Mon, 10 Nov 2014 23:31:30 +0200 Subject: [PATCH] Some minor tweaks. --- rtsp.c | 2 +- sectionfilter.c | 2 +- tuner.c | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/rtsp.c b/rtsp.c index d6d4558..826c511 100644 --- a/rtsp.c +++ b/rtsp.c @@ -10,7 +10,7 @@ cSatipRtsp::cSatipRtsp(cSatipTunerIf &tunerP) : tunerM(&tunerP), - tunerIdM(tunerM ? tunerM->GetId() : -1), + tunerIdM(tunerP.GetId()), handleM(curl_easy_init()), headerListM(NULL) { diff --git a/sectionfilter.c b/sectionfilter.c index e24a48a..d8f10bc 100644 --- a/sectionfilter.c +++ b/sectionfilter.c @@ -231,7 +231,7 @@ bool cSatipSectionFilter::Send(void) cSatipSectionFilterHandler::cSatipSectionFilterHandler(int deviceIndexP, unsigned int bufferLenP) -: cThread("SAT>IP section handler"), +: cThread(cString::sprintf("SAT>IP %d section handler", deviceIndexP)), ringBufferM(new cRingBufferLinear(bufferLenP, TS_SIZE, false, *cString::sprintf("SAT>IP SECTION HANDLER %d", deviceIndexP))), mutexM(), deviceIndexM(deviceIndexP) diff --git a/tuner.c b/tuner.c index abe4a85..7c85431 100644 --- a/tuner.c +++ b/tuner.c @@ -13,10 +13,10 @@ #include "tuner.h" cSatipTuner::cSatipTuner(cSatipDeviceIf &deviceP, unsigned int packetLenP) -: cThread("SAT>IP tuner"), +: cThread(cString::sprintf("SAT>IP %d tuner", deviceP.GetId())), sleepM(), deviceM(&deviceP), - deviceIdM(deviceM ? deviceM->GetId() : -1), + deviceIdM(deviceP.GetId()), packetBufferLenM(packetLenP), rtspM(new cSatipRtsp(*this)), rtpSocketM(new cSatipSocket()), @@ -114,6 +114,7 @@ cSatipTuner::~cSatipTuner() free(packetBufferM); DELETENULL(rtcpSocketM); DELETENULL(rtpSocketM); + DELETENULL(rtspM); } void cSatipTuner::Action(void) @@ -235,9 +236,8 @@ bool cSatipTuner::Disconnect(void) { cMutexLock MutexLock(&mutexM); debug("cSatipTuner::%s() [device %d]", __FUNCTION__, deviceIdM); - openedM = false; - if (!isempty(*streamAddrM)) { + if (openedM && !isempty(*streamAddrM)) { cString uri = cString::sprintf("rtsp://%s/stream=%d", *streamAddrM, streamIdM); rtspM->Teardown(*uri); } @@ -249,6 +249,7 @@ bool cSatipTuner::Disconnect(void) if (currentServerM) cSatipDiscover::GetInstance()->UseServer(currentServerM, false); + openedM = false; tunedM = false; statusUpdateM.Set(0); timeoutM = eMinKeepAliveIntervalMs; @@ -288,7 +289,7 @@ void cSatipTuner::ParseReceptionParameters(const char *paramP) // "0" the frontend is not locked // "1" the frontend is locked c = strstr(c, ","); - hasLockM = atoi(++c); + hasLockM = !!atoi(++c); // quality: // Numerical value between 0 and 15