Fixed tuner shutdown.

This commit is contained in:
Rolf Ahrenberg 2014-11-22 21:32:55 +02:00
parent 5d697c36dc
commit 1f528cf7e1
1 changed files with 14 additions and 2 deletions

16
tuner.c
View File

@ -450,11 +450,23 @@ bool cSatipTuner::StateRequested(void)
bool cSatipTuner::RequestState(eTunerState stateP)
{
cMutexLock MutexLock(&mutexM);
debug("cSatipTuner::%s(%s) [device %d]", __FUNCTION__, TunerStateString(stateP), deviceIdM);
debug("cSatipTuner::%s(%s) %s <> %s [device %d]", __FUNCTION__, TunerStateString(stateP), TunerStateString(currentStateM), TunerStateString(nextStateM), deviceIdM);
// validate legal state changes
switch (currentStateM) {
case tsIdle:
if (stateP == tsRelease)
return false;
case tsRelease:
case tsSet:
case tsLocked:
case tsTuned:
default:
break;
}
nextStateM = stateP;
// validate legal state changes
return true;
}