Skip to content

Commit f73dbda

Browse files
ldkronosgigem
authored andcommitted
Ceton bug fix for handling failed tunings
This patch fixes a bug in code that detects a failed tuning and attempts to retune. Before it was possible for the code to "forget" what channel was attempting to be tuned and thus it could fail to retune properly. Fixes #10526 Signed-off-by: David Engel <dengel@mythtv.org>
1 parent 5320353 commit f73dbda

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

mythtv/libs/libmythtv/cetonstreamhandler.cpp

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -502,14 +502,9 @@ bool CetonStreamHandler::TuneProgram(uint program)
502502
return result;
503503
}
504504

505-
bool CetonStreamHandler::TuneVChannel(const QString &vchannel)
505+
bool CetonStreamHandler::PerformTuneVChannel(const QString &vchannel)
506506
{
507-
if ((vchannel != "0") && (_last_vchannel != "0"))
508-
ClearProgramNumber();
509-
510-
LOG(VB_RECORD, LOG_INFO, LOC + QString("TuneVChannel(%1)").arg(vchannel));
511-
512-
_last_vchannel = vchannel;
507+
LOG(VB_RECORD, LOG_INFO, LOC + QString("PerformTuneVChannel(%1)").arg(vchannel));
513508

514509
QUrl params;
515510
params.addQueryItem("instance_id", QString::number(_tuner));
@@ -523,16 +518,30 @@ bool CetonStreamHandler::TuneVChannel(const QString &vchannel)
523518
if (!result)
524519
{
525520
LOG(VB_GENERAL, LOG_ERR, LOC +
526-
QString("TuneVChannel() - HTTP status = %1 - response = %2")
521+
QString("PerformTuneVChannel() - HTTP status = %1 - response = %2")
527522
.arg(status).arg(response));
528523
}
529524

530525
return result;
531526
}
532527

528+
529+
bool CetonStreamHandler::TuneVChannel(const QString &vchannel)
530+
{
531+
if ((vchannel != "0") && (_last_vchannel != "0"))
532+
ClearProgramNumber();
533+
534+
LOG(VB_RECORD, LOG_INFO, LOC + QString("TuneVChannel(%1)").arg(vchannel));
535+
536+
_last_vchannel = vchannel;
537+
538+
return PerformTuneVChannel(vchannel);
539+
}
540+
533541
void CetonStreamHandler::ClearProgramNumber(void)
534542
{
535-
TuneVChannel("0");
543+
LOG(VB_RECORD, LOG_INFO, LOC + QString("ClearProgramNumber()"));
544+
PerformTuneVChannel("0");
536545
for(int i=0; i<50; i++)
537546
{
538547
if (GetVar("mux", "ProgramNumber") == "0")

mythtv/libs/libmythtv/cetonstreamhandler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class CetonStreamHandler : public StreamHandler
5555
void RepeatTuning(void);
5656

5757
bool TunerOff(void);
58+
bool PerformTuneVChannel(const QString &vchannel);
5859
void ClearProgramNumber(void);
5960

6061
QString GetVar(const QString &section, const QString &variable) const;

0 commit comments

Comments
 (0)