Ticket #1772: ajm_scheduler_v2.patch
File ajm_scheduler_v2.patch, 8.3 KB (added by , 18 years ago) |
---|
-
programs/mythbackend/scheduler.cpp
old new 417 417 << p->chanstr.rightJustify(4, ' ') << " " << p->chanid 418 418 << p->recstartts.toString(" dd hh:mm-").local8Bit() 419 419 << p->recendts.toString("hh:mm ").local8Bit() 420 << p->cardid << " " << p->inputid << " "420 << p->cardid << " " << p->inputid << " " << p->mplexid << " " 421 421 << p->RecTypeChar() << " " << p->RecStatusChar() << " " 422 422 << (QString::number(p->recpriority) + "/" + 423 423 QString::number(p->recpriority2)).rightJustify(5, ' ') … … 681 681 continue; 682 682 if (p->recendts <= q->recstartts || p->recstartts >= q->recendts) 683 683 continue; 684 if (p->inputid == q->inputid && p->mplexid == q->mplexid) // if mplex ids are the same don't conflict 685 continue; 684 686 if (p->inputid == q->inputid && p->shareable) 685 687 continue; 686 688 … … 1320 1322 continue; 1321 1323 } 1322 1324 1325 // SPLIT need a EncoderLink::IsBusyRecordingDifferentMux() 1326 //if (!nexttv->IsBusyRecording()) 1327 VERBOSE(VB_RECORD, LOC + "Before IsBusyRecordingAndNotShareable"); 1328 //if (!nexttv->IsBusyRecordingAndNotShareable(nextRecording)) 1323 1329 if (!nexttv->IsBusyRecording()) 1324 1330 { 1325 // Will use pre-roll settings only if no other 1326 // program is currently being recorded 1331 VERBOSE(VB_RECORD, LOC + "During IsBusyRecordingAndNotShareable"); 1332 // Will use pre-roll settings only if the 1333 // recorder is recording on the same mux 1327 1334 secsleft -= prerollseconds; 1328 1335 } 1336 VERBOSE(VB_RECORD, LOC + "After IsBusyRecordingAndNotShareable"); 1329 1337 1330 1338 //VERBOSE(VB_GENERAL, secsleft << " seconds until " << nextRecording->title); 1331 1339 … … 2020 2028 "program.airdate, program.stars, program.originalairdate, RECTABLE.inactive, " 2021 2029 "RECTABLE.parentid, ") + progfindid + ", RECTABLE.playgroup, " 2022 2030 "oldrecstatus.recstatus, oldrecstatus.reactivate, " 2023 "channel.recpriority + cardinput.recpriority, program.hdtv " 2031 "channel.recpriority + cardinput.recpriority, program.hdtv, " 2032 "channel.mplexid " 2024 2033 + QString( 2025 2034 "FROM recordmatch " 2026 2035 … … 2158 2167 p->chancommfree = result.value(23).toInt(); 2159 2168 p->cardid = result.value(24).toInt(); 2160 2169 p->inputid = result.value(25).toInt(); 2170 p->mplexid = result.value(41).toInt(); 2161 2171 p->shareable = result.value(26).toInt(); 2162 2172 p->seriesid = result.value(27).toString(); 2163 2173 p->programid = result.value(28).toString(); … … 2277 2287 "RECTABLE.starttime, RECTABLE.startdate, RECTABLE.endtime, RECTABLE.enddate, " 2278 2288 "RECTABLE.startoffset, RECTABLE.endoffset, " 2279 2289 "RECTABLE.title, RECTABLE.subtitle, RECTABLE.description, " 2280 "channel.channum, channel.callsign, channel.name "2290 "channel.channum, channel.callsign, channel.name, channel.mplexid " 2281 2291 "FROM RECTABLE " 2282 2292 " INNER JOIN channel ON (channel.chanid = RECTABLE.chanid) " 2283 2293 " LEFT JOIN recordmatch on RECTABLE.recordid = recordmatch.recordid " … … 2348 2358 p->chanstr = result.value(12).toString(); 2349 2359 p->chansign = QString::fromUtf8(result.value(13).toString()); 2350 2360 p->channame = QString::fromUtf8(result.value(14).toString()); 2361 p->mplexid = result.value(15).toInt(); 2351 2362 2352 2363 p->schedulerid = p->startts.toString() + "_" + p->chanid; 2353 2364 … … 2371 2382 "channel.name, RECTABLE.recordid, RECTABLE.recgroup, RECTABLE.dupin, " 2372 2383 "RECTABLE.dupmethod, channel.commfree, channel.channum, RECTABLE.station, " 2373 2384 "RECTABLE.seriesid, RECTABLE.programid, RECTABLE.category, RECTABLE.findid, " 2374 "RECTABLE.playgroup "2385 "RECTABLE.playgroup, channel.mplexid " 2375 2386 "FROM RECTABLE " 2376 2387 "LEFT JOIN channel ON channel.callsign = RECTABLE.station " 2377 2388 "GROUP BY recordid " … … 2447 2458 proginfo->programid = result.value(19).toString(); 2448 2459 proginfo->category = result.value(20).toString(); 2449 2460 proginfo->findid = result.value(21).toInt(); 2461 proginfo->mplexid = result.value(23).toInt(); 2450 2462 2451 2463 proginfo->recstartts = proginfo->startts; 2452 2464 proginfo->recendts = proginfo->endts; -
libs/libmythtv/programinfo.cpp
old new 104 104 sourceid = 0; 105 105 inputid = 0; 106 106 cardid = 0; 107 mplexid = 0; 107 108 shareable = false; 108 109 duplicate = false; 109 110 schedulerid = ""; … … 195 196 sourceid = other.sourceid; 196 197 inputid = other.inputid; 197 198 cardid = other.cardid; 199 mplexid = other.mplexid; 198 200 shareable = other.shareable; 199 201 duplicate = other.duplicate; 200 202 schedulerid = QDeepCopy<QString>(other.schedulerid); … … 283 285 STR_TO_LIST(hostname) 284 286 INT_TO_LIST(sourceid) 285 287 INT_TO_LIST(cardid) 288 INT_TO_LIST(mplexid) 286 289 INT_TO_LIST(inputid) 287 290 INT_TO_LIST(recpriority) 288 291 INT_TO_LIST(recstatus) … … 381 384 STR_FROM_LIST(hostname) 382 385 INT_FROM_LIST(sourceid) 383 386 INT_FROM_LIST(cardid) 387 INT_FROM_LIST(mplexid) 384 388 INT_FROM_LIST(inputid) 385 389 INT_FROM_LIST(recpriority) 386 390 ENUM_FROM_LIST(recstatus, RecStatusType) … … 2984 2988 recstartts = found->recstartts; 2985 2989 recendts = found->recendts; 2986 2990 cardid = found->cardid; 2991 mplexid = found->mplexid; 2987 2992 inputid = found->inputid; 2988 2993 } 2989 2994 return found; … … 4085 4090 p->recstartts = s->recstartts; 4086 4091 p->recendts = s->recendts; 4087 4092 p->cardid = s->cardid; 4093 p->mplexid = s->mplexid; 4088 4094 p->inputid = s->inputid; 4089 4095 p->dupin = s->dupin; 4090 4096 p->dupmethod = s->dupmethod; -
libs/libmythtv/programinfo.h
old new 300 300 int sourceid; 301 301 int inputid; 302 302 int cardid; 303 int mplexid; 303 304 bool shareable; 304 305 bool duplicate; 305 306 -
programs/mythbackend/encoderlink.cpp
old new 122 122 return retval; 123 123 } 124 124 125 /** \fn EncoderLink::IsBusyRecordingAndNotShareable() 126 * \brief Returns true if the TVRec state is in a recording state and not shareable with rec 127 * 128 * Contrast with IsBusyRecording() which returns true if it is recording. 129 * 130 * \sa IsBusyRecording() 131 */ 132 bool EncoderLink::IsBusyRecordingAndNotShareable(const ProgramInfo *rec) 133 { 134 bool retval = false; 135 ProgramList tvrecList; 136 137 if (local) 138 { 139 while (kState_ChangingState == GetState()) 140 usleep(100); 141 142 if (IsBusyRecording()) 143 tvrecList = tv->GetRecordings(); 144 145 if (!tvrecList.isEmpty()) 146 { 147 ProgramInfo *tvrec = tvrecList.first(); 148 retval = (tvrec->mplexid != rec->mplexid); 149 150 tvrecList.setAutoDelete(true); 151 } 152 } 153 else if (sock) 154 retval = sock->EncoderIsRecording(m_capturecardnum, rec); 155 156 return retval; 157 } 158 125 159 /** \fn EncoderLink::GetState() 126 160 * \brief Returns the TVState of the recorder. 127 161 * \sa TVRec::GetState(), \ref recorder_subsystem -
programs/mythbackend/encoderlink.h
old new 52 52 53 53 bool IsBusy(void); 54 54 bool IsBusyRecording(void); 55 bool IsBusyRecordingAndNotShareable(const ProgramInfo *rec); 55 56 56 57 TVState GetState(); 57 58 bool IsRecording(const ProgramInfo *rec); // scheduler call only.