diff -rup libmythtv_hack_clean/tv_rec.cpp libmythtv/tv_rec.cpp
old
|
new
|
bool TVRec::Init(void) |
151 | 151 | if (!ok) |
152 | 152 | return false; |
153 | 153 | |
154 | | QString startchannel = GetStartChannel(cardid, genOpt.defaultinput); |
| 154 | QString startchannel = GetStartChannel(cardid, QString::null); |
155 | 155 | |
156 | 156 | bool init_run = false; |
157 | 157 | if (genOpt.cardtype == "DVB") |
… |
… |
bool TVRec::GetDevices(int cardid, |
1410 | 1410 | return true; |
1411 | 1411 | } |
1412 | 1412 | |
1413 | | QString TVRec::GetStartChannel(int cardid, const QString &defaultinput) |
| 1413 | QString TVRec::GetStartChannel(int cardid, const QString &input) |
1414 | 1414 | { |
| 1415 | QString defaultinput; |
1415 | 1416 | QString msg(""); |
1416 | 1417 | QString startchan = QString::null; |
1417 | 1418 | |
| 1419 | if (input == QString::null) |
| 1420 | { |
| 1421 | // Get the last viewed input |
| 1422 | MSqlQuery query(MSqlQuery::InitCon()); |
| 1423 | query.prepare( |
| 1424 | "SELECT defaultinput " |
| 1425 | "FROM capturecard " |
| 1426 | "WHERE cardid = :CARDID"); |
| 1427 | query.bindValue(":CARDID", cardid); |
| 1428 | |
| 1429 | if (!query.exec() || !query.isActive()) |
| 1430 | MythContext::DBError("getdefaultinput", query); |
| 1431 | else if (query.next()) |
| 1432 | defaultinput = query.value(0).toString(); |
| 1433 | } |
| 1434 | else |
| 1435 | defaultinput = input; |
| 1436 | |
1418 | 1437 | // Get last tuned channel from database, to use as starting channel |
1419 | 1438 | MSqlQuery query(MSqlQuery::InitCon()); |
1420 | 1439 | query.prepare( |
… |
… |
void TVRec::TuningFrequency(const Tuning |
3417 | 3436 | |
3418 | 3437 | // If this is Live TV startup, we need a channel... |
3419 | 3438 | if (channum.isEmpty() && (request.flags & kFlagLiveTV)) |
3420 | | { |
3421 | | input = genOpt.defaultinput; |
3422 | | channum = GetStartChannel(cardid, input); |
3423 | | } |
| 3439 | channum = GetStartChannel(cardid, QString::null); |
3424 | 3440 | } |
3425 | 3441 | bool ok = false; |
3426 | 3442 | if (channel) |
diff -rup libmythtv_hack_clean/tv_rec.h libmythtv/tv_rec.h
old
|
new
|
class TVRec : public QObject |
267 | 267 | DBox2DBOptions &dbox2_opts); |
268 | 268 | |
269 | 269 | |
270 | | static QString GetStartChannel(int cardid, const QString &defaultinput); |
| 270 | static QString GetStartChannel(int cardid, const QString &input=QString::null); |
271 | 271 | |
272 | 272 | bool SetupRecorder(RecordingProfile& profile); |
273 | 273 | void TeardownRecorder(bool killFile = false); |
diff -rup libmythtv_clean/tv_play.cpp libmythtv/tv_play.cpp
old
|
new
|
void TV::ChangeChannel(uint chanid, cons |
3829 | 3829 | if (prevChan.size() == 0) |
3830 | 3830 | AddPreviousChannel(); |
3831 | 3831 | |
| 3832 | // Save new input |
| 3833 | QString inputname(""); |
| 3834 | int cardid = -1; |
| 3835 | |
| 3836 | MSqlQuery query(MSqlQuery::InitCon()); |
| 3837 | query.prepare("SELECT cardid FROM channel,cardinput " |
| 3838 | "WHERE channel.sourceid = cardinput.sourceid " |
| 3839 | "AND chanid = :CHANID"); |
| 3840 | query.bindValue(":CHANID", chanid); |
| 3841 | if (query.exec() && query.isActive() && query.size() > 0 && query.next()) |
| 3842 | cardid = query.value(0).toInt(); |
| 3843 | else |
| 3844 | MythContext::DBError("GetNewCardID", query); |
| 3845 | |
| 3846 | if (cardid >= 0) |
| 3847 | if (get_cardinputid(cardid, channum, inputname) >= 0) |
| 3848 | set_startinput(cardid, inputname); |
3832 | 3849 | PauseLiveTV(); |
3833 | 3850 | |
3834 | 3851 | activerecorder->SetChannel(channum); |