diff -Naur mythtv-0.27-20140225-g28b768a-old/mythtv/libs/libmythtv/recorders/dvbchannel.cpp mythtv-0.27-20140225-g28b768a-new/mythtv/libs/libmythtv/recorders/dvbchannel.cpp
old
|
new
|
|
55 | 55 | static DTVMultiplex dvbparams_to_dtvmultiplex( |
56 | 56 | DTVTunerType, const dvb_frontend_parameters&); |
57 | 57 | |
| 58 | qint64 concurrent_tunings_delay = 1000; |
| 59 | QDateTime DVBChannel::last_tuning = QDateTime::currentDateTime(); |
| 60 | |
58 | 61 | #define LOC QString("DVBChan[%1](%2): ").arg(GetCardID()).arg(GetDevice()) |
59 | 62 | |
60 | 63 | /** \class DVBChannel |
… |
… |
|
96 | 99 | master_map_lock.unlock(); |
97 | 100 | |
98 | 101 | sigmon_delay = CardUtil::GetMinSignalMonitoringDelay(device); |
| 102 | |
99 | 103 | } |
100 | 104 | |
101 | 105 | DVBChannel::~DVBChannel() |
… |
… |
|
710 | 714 | |
711 | 715 | if (reset || !prev_tuning.IsEqual(tunerType, tuning, 500 * freq_mult)) |
712 | 716 | { |
| 717 | |
713 | 718 | LOG(VB_CHANNEL, LOG_INFO, LOC + QString("Tune(): Tuning to %1%2") |
714 | 719 | .arg(intermediate_freq ? intermediate_freq : tuning.frequency) |
715 | 720 | .arg(suffix)); |
716 | 721 | |
| 722 | tune_delay_lock.lock(); |
| 723 | |
| 724 | if (QDateTime::currentDateTime() < last_tuning) |
| 725 | { |
| 726 | LOG(VB_GENERAL, LOG_INFO, LOC + QString("Next tuning after less than %1ms. Delaying by %1ms") |
| 727 | .arg(concurrent_tunings_delay)); |
| 728 | usleep(concurrent_tunings_delay * 1000); |
| 729 | } |
| 730 | |
| 731 | last_tuning = QDateTime::currentDateTime(); |
| 732 | last_tuning = last_tuning.addMSecs(concurrent_tunings_delay); |
| 733 | |
| 734 | tune_delay_lock.unlock(); |
| 735 | |
717 | 736 | // send DVB-S setup |
718 | 737 | if (diseqc_tree) |
719 | 738 | { |
… |
… |
|
812 | 831 | "Tune(): Setting Frontend tuning parameters failed." + ENO); |
813 | 832 | return false; |
814 | 833 | } |
| 834 | |
815 | 835 | } |
816 | 836 | else |
817 | 837 | #endif |
diff -Naur mythtv-0.27-20140225-g28b768a-old/mythtv/libs/libmythtv/recorders/dvbchannel.h mythtv-0.27-20140225-g28b768a-new/mythtv/libs/libmythtv/recorders/dvbchannel.h
old
|
new
|
|
144 | 144 | int fd_frontend; ///< File descriptor for tuning hardware |
145 | 145 | QString device; ///< DVB Device |
146 | 146 | bool has_crc_bug; ///< true iff our driver munges PMT |
| 147 | |
| 148 | static QDateTime last_tuning; |
| 149 | QMutex tune_delay_lock; |
| 150 | |
147 | 151 | }; |
148 | 152 | |
149 | 153 | #endif |