From 8bd4a1a67d9a187eeed8b9547d9db8f69e79b7fc Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Sun, 23 Nov 2014 00:13:15 +0200 Subject: [PATCH] Fixed teardown. --- tuner.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tuner.c b/tuner.c index d5ababa..219991e 100644 --- a/tuner.c +++ b/tuner.c @@ -227,6 +227,7 @@ bool cSatipTuner::Disconnect(void) if (!isempty(*streamAddrM) && (streamIdM >= 0)) { cString uri = cString::sprintf("rtsp://%s/stream=%d", *streamAddrM, streamIdM); rtspM.Teardown(*uri); + streamIdM = -1; } //currentStateM = tsIdle; //nextStateM = tsIdle; @@ -457,6 +458,9 @@ bool cSatipTuner::RequestState(eTunerState stateP) cMutexLock MutexLock(&mutexM); debug("cSatipTuner::%s(%s) current=%s next=%s [device %d]", __FUNCTION__, TunerStateString(stateP), TunerStateString(currentStateM), TunerStateString(nextStateM), deviceIdM); + if (currentStateM != nextStateM) + debug("cSatipTuner::%s() invalid state change attempt [device %d]", __FUNCTION__, deviceIdM); + // validate legal state changes switch (currentStateM) { case tsIdle: