Ticket #1945: diseqc-sigmon-rotor.patch
File diseqc-sigmon-rotor.patch, 2.1 KB (added by , 19 years ago) |
---|
-
libs/libmythtv/dvbsignalmonitor.cpp
509 509 } 510 510 511 511 // Rotor position 512 const DiSEqCDevRotor *rotor = dvbchan->GetRotor(); 513 if (rotor && rotor->IsPositionKnown()) 512 if (HasFlags(kDVBSigMon_WaitForPos)) 514 513 { 515 double progress = rotor->GetProgress(); 516 QMutexLocker locker(&statusLock); 517 if (progress >= 1.0 && !rotorPosition.IsGood()) 514 const DiSEqCDevRotor *rotor = dvbchan->GetRotor(); 515 if (rotor) 518 516 { 519 DBG_SM("UpdateValues", "Retuning for rotor completion"); 520 dvbchan->Retune(); 517 bool was_moving, is_moving; 518 { 519 QMutexLocker locker(&statusLock); 520 was_moving = rotorPosition.GetValue() < 100; 521 rotorPosition.SetValue((int)truncf(rotor->GetProgress() * 100)); 522 is_moving = rotorPosition.GetValue() < 100; 523 } 524 525 // Retune if move completes normally 526 if (was_moving && !is_moving) 527 { 528 DBG_SM("UpdateValues", "Retuning for rotor completion"); 529 dvbchan->Retune(); 521 530 522 rotorPosition.SetValue(100); 531 // No need to wait for SDT anymore 532 RemoveFlags(kDTVSigMon_WaitForSDT); 533 } 523 534 } 524 else if (progress < 1.0) 535 536 // If no rotor is present, pretend the movement is completed 537 else 525 538 { 526 if (rotorPosition.IsGood())527 DBG_SM("UpdateValues", "Rotor is moving");528 529 539 QMutexLocker locker(&statusLock); 530 rotorPosition.SetValue( (int)truncf(progress * 100));540 rotorPosition.SetValue(100); 531 541 } 532 542 } 533 else if (!rotor && HasFlags(kDVBSigMon_WaitForPos))534 {535 QMutexLocker locker(&statusLock);536 rotorPosition.SetValue(100);537 }538 543 539 544 // Periodically retune if card can't recover 540 545 if (!dvbchan->IsSelfRetuning() && !is_locked &&