diff --git a/mythtv/programs/mythbackend/scheduler.cpp b/mythtv/programs/mythbackend/scheduler.cpp
index 3db2883..8c2a985 100644
a
|
b
|
bool Scheduler::TryAnotherShowing(RecordingInfo *p, bool samePriority, |
1220 | 1220 | |
1221 | 1221 | q->SetRecordingStatus(rsWillRecord); |
1222 | 1222 | MarkOtherShowings(q); |
| 1223 | if (q->GetRecordingStartTime() < livetvTime) |
| 1224 | livetvTime = q->GetRecordingStartTime(); |
1223 | 1225 | PrintRec(p, " -"); |
1224 | 1226 | PrintRec(q, " +"); |
1225 | 1227 | return true; |
… |
… |
void Scheduler::SchedNewRecords(void) |
1255 | 1257 | "- = unschedule a showing in favor of another one"); |
1256 | 1258 | } |
1257 | 1259 | |
| 1260 | livetvTime = QDateTime::currentDateTime().addSecs(3600); |
1258 | 1261 | int openEnd = gCoreContext->GetNumSetting("SchedOpenEnd", 0); |
1259 | 1262 | |
1260 | 1263 | RecIter i = worklist.begin(); |
… |
… |
void Scheduler::SchedNewRecords(void) |
1270 | 1273 | if (!conflict) |
1271 | 1274 | { |
1272 | 1275 | p->SetRecordingStatus(rsWillRecord); |
1273 | | |
1274 | | if (p->GetRecordingStartTime() < schedTime.addSecs(90)) |
1275 | | { |
1276 | | QString id = p->MakeUniqueSchedulerKey(); |
1277 | | if (!recPendingList.contains(id)) |
1278 | | recPendingList[id] = false; |
1279 | | |
1280 | | livetvTime = (livetvTime < schedTime) ? |
1281 | | schedTime : livetvTime; |
1282 | | } |
1283 | | |
1284 | 1276 | MarkOtherShowings(p); |
| 1277 | if (p->GetRecordingStartTime() < livetvTime) |
| 1278 | livetvTime = p->GetRecordingStartTime(); |
1285 | 1279 | PrintRec(p, " +"); |
1286 | 1280 | } |
1287 | 1281 | else |
… |
… |
void Scheduler::MoveHigherRecords(bool move_this) |
1328 | 1322 | } |
1329 | 1323 | |
1330 | 1324 | if (p->GetRecordingStatus() == rsWillRecord) |
| 1325 | { |
| 1326 | if (p->GetRecordingStartTime() < livetvTime) |
| 1327 | livetvTime = p->GetRecordingStartTime(); |
1331 | 1328 | PrintRec(p, " +"); |
| 1329 | } |
1332 | 1330 | } |
1333 | 1331 | |
1334 | 1332 | i = retrylist.begin(); |
… |
… |
void Scheduler::MoveHigherRecords(bool move_this) |
1361 | 1359 | } |
1362 | 1360 | |
1363 | 1361 | if (move_this && p->GetRecordingStatus() == rsWillRecord) |
| 1362 | { |
| 1363 | if (p->GetRecordingStartTime() < livetvTime) |
| 1364 | livetvTime = p->GetRecordingStartTime(); |
1364 | 1365 | PrintRec(p, " +"); |
| 1366 | } |
1365 | 1367 | } |
1366 | 1368 | } |
1367 | 1369 | |
… |
… |
int Scheduler::CalcTimeToNextHandleRecordingEvent( |
1972 | 1974 | int secs_to_next = curtime.secsTo((*i)->GetRecordingStartTime()); |
1973 | 1975 | |
1974 | 1976 | if ((*i)->GetRecordingStatus() == rsWillRecord && |
1975 | | !recPendingList[(*i)->MakeUniqueSchedulerKey()]) |
| 1977 | !recPendingList.contains((*i)->MakeUniqueSchedulerKey())) |
1976 | 1978 | secs_to_next -= 30; |
1977 | 1979 | |
1978 | 1980 | if (secs_to_next < 0) |
… |
… |
bool Scheduler::HandleRecording( |
2318 | 2320 | if (!recPendingList.contains(schedid)) |
2319 | 2321 | { |
2320 | 2322 | recPendingList[schedid] = false; |
2321 | | |
2322 | | livetvTime = (livetvTime < nextrectime) ? |
2323 | | nextrectime : livetvTime; |
2324 | | |
2325 | | m_queueLock.lock(); |
2326 | | reschedQueue.enqueue(0); |
2327 | | m_queueLock.unlock(); |
| 2323 | if (schedTime.secsTo(curtime) > 15) |
| 2324 | { |
| 2325 | m_queueLock.lock(); |
| 2326 | reschedQueue.enqueue(0); |
| 2327 | m_queueLock.unlock(); |
| 2328 | } |
2328 | 2329 | } |
2329 | 2330 | } |
2330 | 2331 | |
… |
… |
bool Scheduler::HandleRecording( |
2476 | 2477 | schedLock.unlock(); |
2477 | 2478 | recStatus = nexttv->StartRecording(&tempri); |
2478 | 2479 | schedLock.lock(); |
| 2480 | recPendingList.remove(schedid); |
2479 | 2481 | |
2480 | 2482 | // activate auto expirer |
2481 | 2483 | if (m_expirer) |
… |
… |
void Scheduler::FillDirectoryInfoCache(bool force) |
4926 | 4928 | |
4927 | 4929 | void Scheduler::SchedPreserveLiveTV(void) |
4928 | 4930 | { |
4929 | | if (!livetvTime.isValid()) |
4930 | | return; |
| 4931 | int prerollseconds = gCoreContext->GetNumSetting("RecordPreRoll", 0); |
| 4932 | QDateTime curtime = QDateTime::currentDateTime(); |
| 4933 | int secsleft = curtime.secsTo(livetvTime); |
4931 | 4934 | |
4932 | | if (livetvTime < schedTime) |
4933 | | { |
4934 | | livetvTime = QDateTime(); |
| 4935 | if (secsleft - prerollseconds > 120) |
4935 | 4936 | return; |
4936 | | } |
4937 | 4937 | |
4938 | 4938 | livetvpriority = gCoreContext->GetNumSetting("LiveTVPriority", 0); |
4939 | 4939 | |