Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refs #10872. Use desired start and end times for recording quality.

This is the rest of [07acf0e]. The constructors weren't right in
the previous commit and we need to get updated desired times to
the recorder for the recording quality determination to use them.
  • Loading branch information...
commit 16231c959b2edbef011636e3c8df6e66933899e9 1 parent ecc1525
@daniel-kristjansson daniel-kristjansson authored daniel-kristjansson committed
View
4 mythtv/libs/libmythtv/dtvrecorder.cpp
@@ -1343,9 +1343,9 @@ bool DTVRecorder::ProcessAVTSPacket(const TSPacket &tspacket)
return true;
}
-RecordingQuality *DTVRecorder::GetRecordingQuality(void) const
+RecordingQuality *DTVRecorder::GetRecordingQuality(const RecordingInfo *r) const
{
- RecordingQuality *recq = RecorderBase::GetRecordingQuality();
+ RecordingQuality *recq = RecorderBase::GetRecordingQuality(r);
recq->AddTSStatistics(
_continuity_error_count.fetchAndAddRelaxed(0),
_packet_count.fetchAndAddRelaxed(0));
View
2  mythtv/libs/libmythtv/dtvrecorder.h
@@ -57,7 +57,7 @@ class DTVRecorder :
virtual void Reset(void);
virtual void ClearStatistics(void);
- virtual RecordingQuality *GetRecordingQuality(void) const;
+ virtual RecordingQuality *GetRecordingQuality(const RecordingInfo*) const;
// MPEG Stream Listener
void HandlePAT(const ProgramAssociationTable*);
View
11 mythtv/libs/libmythtv/recorderbase.cpp
@@ -308,7 +308,7 @@ void RecorderBase::CheckForRingBufferSwitch(void)
{
FinishRecording();
- recq = GetRecordingQuality();
+ recq = GetRecordingQuality(NULL);
ResetForNewFile();
@@ -340,9 +340,16 @@ void RecorderBase::ClearStatistics(void)
recordingGaps.clear();
}
-RecordingQuality *RecorderBase::GetRecordingQuality(void) const
+RecordingQuality *RecorderBase::GetRecordingQuality(
+ const RecordingInfo *r) const
{
QMutexLocker locker(&statisticsLock);
+ if (r && curRecording &&
+ (r->MakeUniqueKey() == curRecording->MakeUniqueKey()))
+ {
+ curRecording->SetDesiredStartTime(r->GetDesiredStartTime());
+ curRecording->SetDesiredEndTime(r->GetDesiredEndTime());
+ }
return new RecordingQuality(
curRecording, recordingGaps,
timeOfFirstData, timeOfLatestData);
View
2  mythtv/libs/libmythtv/recorderbase.h
@@ -179,7 +179,7 @@ class MTV_PUBLIC RecorderBase : public QRunnable
virtual bool IsRecordingRequested(void);
/// \brief Returns a report about the current recordings quality.
- virtual RecordingQuality *GetRecordingQuality(void) const;
+ virtual RecordingQuality *GetRecordingQuality(const RecordingInfo*) const;
// pausing interface
virtual void Pause(bool clear = true);
View
13 mythtv/libs/libmythtv/recordinginfo.cpp
@@ -110,8 +110,8 @@ RecordingInfo::RecordingInfo(
oldrecstatus(_oldrecstatus),
savedrecstatus(rsUnknown),
future(_future),
- desiredrecstartts(_recstartts),
- desiredrecendts(_recendts),
+ desiredrecstartts(_startts),
+ desiredrecendts(_endts),
record(NULL)
{
hostname = _hostname;
@@ -205,8 +205,8 @@ RecordingInfo::RecordingInfo(
oldrecstatus(rsUnknown),
savedrecstatus(rsUnknown),
future(false),
- desiredrecstartts(_recstartts),
- desiredrecendts(_recendts),
+ desiredrecstartts(_startts),
+ desiredrecendts(_endts),
record(NULL)
{
recpriority = _recpriority;
@@ -238,6 +238,8 @@ RecordingInfo::RecordingInfo(
oldrecstatus(rsUnknown),
savedrecstatus(rsUnknown),
future(false),
+ desiredrecstartts(),
+ desiredrecendts(),
record(NULL)
{
ProgramList schedList;
@@ -358,6 +360,9 @@ RecordingInfo::RecordingInfo(
if (status)
*status = kFakedLiveTVProgram;
+
+ desiredrecstartts = startts;
+ desiredrecendts = endts;
}
/// \brief Copies important fields from other RecordingInfo.
View
10 mythtv/libs/libmythtv/recordinginfo.h
@@ -36,24 +36,32 @@ class MTV_PUBLIC RecordingInfo : public ProgramInfo
oldrecstatus(rsUnknown),
savedrecstatus(rsUnknown),
future(false),
+ desiredrecstartts(),
+ desiredrecendts(),
record(NULL) {}
RecordingInfo(const RecordingInfo &other) :
ProgramInfo(other),
oldrecstatus(other.oldrecstatus),
savedrecstatus(other.savedrecstatus),
future(other.future),
+ desiredrecstartts(other.desiredrecstartts),
+ desiredrecendts(other.desiredrecendts),
record(NULL) {}
RecordingInfo(const ProgramInfo &other) :
ProgramInfo(other),
oldrecstatus(rsUnknown),
savedrecstatus(rsUnknown),
future(false),
+ desiredrecstartts(startts),
+ desiredrecendts(endts),
record(NULL) {}
RecordingInfo(uint _chanid, const QDateTime &_recstartts) :
ProgramInfo(_chanid, _recstartts),
oldrecstatus(rsUnknown),
savedrecstatus(rsUnknown),
future(false),
+ desiredrecstartts(startts),
+ desiredrecendts(endts),
record(NULL) {}
RecordingInfo(QStringList::const_iterator &it,
QStringList::const_iterator end) :
@@ -61,6 +69,8 @@ class MTV_PUBLIC RecordingInfo : public ProgramInfo
oldrecstatus(rsUnknown),
savedrecstatus(rsUnknown),
future(false),
+ desiredrecstartts(startts),
+ desiredrecendts(endts),
record(NULL) {}
/// Create RecordingInfo from 'program'+'record'+'channel' tables,
/// used in scheduler.cpp @ ~ 3296
View
35 mythtv/libs/libmythtv/tv_rec.cpp
@@ -260,7 +260,7 @@ ProgramInfo *TVRec::GetRecording(void)
return tmppginfo;
}
-/** \fn TVRec::RecordPending(const ProgramInfo*, int, bool)
+/** \fn TVRec::RecordPending(const RecordingInfo*, int, bool)
* \brief Tells TVRec "rcinfo" is the next pending recording.
*
* When there is a pending recording and the frontend is in "Live TV"
@@ -324,12 +324,12 @@ void TVRec::RecordPending(const ProgramInfo *rcinfo, int secsleft,
pendlock.relock();
}
-/** \fn TVRec::SetPseudoLiveTVRecording(ProgramInfo*)
- * \brief Sets the pseudo LiveTV ProgramInfo
+/** \fn TVRec::SetPseudoLiveTVRecording(RecordingInfo*)
+ * \brief Sets the pseudo LiveTV RecordingInfo
*/
-void TVRec::SetPseudoLiveTVRecording(ProgramInfo *pi)
+void TVRec::SetPseudoLiveTVRecording(RecordingInfo *pi)
{
- ProgramInfo *old_rec = pseudoLiveTVRecording;
+ RecordingInfo *old_rec = pseudoLiveTVRecording;
pseudoLiveTVRecording = pi;
if (old_rec)
delete old_rec;
@@ -401,8 +401,13 @@ void TVRec::CancelNextRecording(bool cancel)
* \sa EncoderLink::StartRecording(const ProgramInfo*)
* RecordPending(const ProgramInfo*, int, bool), StopRecording()
*/
-RecStatusType TVRec::StartRecording(const ProgramInfo *rcinfo)
+RecStatusType TVRec::StartRecording(const ProgramInfo *pginfo)
{
+ RecordingInfo ri(*pginfo);
+ ri.SetDesiredStartTime(ri.GetRecordingStartTime());
+ ri.SetDesiredEndTime(ri.GetRecordingEndTime());
+ RecordingInfo *rcinfo = &ri;
+
LOG(VB_RECORD, LOG_INFO, LOC + QString("StartRecording(%1)")
.arg(rcinfo->toString(ProgramInfo::kTitleSubtitle)));
@@ -599,7 +604,7 @@ RecStatusType TVRec::StartRecording(const ProgramInfo *rcinfo)
}
else if (!cancelNext && (GetState() == kState_WatchingLiveTV))
{
- SetPseudoLiveTVRecording(new ProgramInfo(*rcinfo));
+ SetPseudoLiveTVRecording(new RecordingInfo(*rcinfo));
recordEndTime = GetRecordEndTime(rcinfo);
SetRecordingStatus(rsRecording, __LINE__);
@@ -705,7 +710,11 @@ void TVRec::StopRecording(bool killFile)
if (killFile)
SetFlags(kFlagKillRec);
else if (curRecording)
- curRecording->SetDesiredEndTime(MythDate::current(true));
+ {
+ QDateTime now = MythDate::current(true);
+ if (now < curRecording->GetDesiredEndTime())
+ curRecording->SetDesiredEndTime(now);
+ }
ChangeState(RemoveRecording(GetState()));
// wait for state change to take effect
WaitForEventThreadSleep();
@@ -799,7 +808,7 @@ void TVRec::StartedRecording(RecordingInfo *curRec)
* programs. If the recording type is kFindOneRecord this find
* is removed.
* \sa ProgramInfo::FinishedRecording(bool prematurestop)
- * \param curRec ProgramInfo or recording to mark as done
+ * \param curRec RecordingInfo or recording to mark as done
*/
void TVRec::FinishedRecording(RecordingInfo *curRec, RecordingQuality *recq)
{
@@ -1091,7 +1100,7 @@ void TVRec::TeardownRecorder(uint request_flags)
if (GetV4LChannel())
channel->SetFd(-1);
- recq = recorder->GetRecordingQuality();
+ recq = recorder->GetRecordingQuality(curRecording);
QMutexLocker locker(&stateChangeLock);
delete recorder;
@@ -2625,7 +2634,7 @@ void TVRec::CheckForRecGroupChange(void)
if (recgrp != "LiveTV" && !pseudoLiveTVRecording)
{
// User wants this recording to continue
- SetPseudoLiveTVRecording(new ProgramInfo(*curRecording));
+ SetPseudoLiveTVRecording(new RecordingInfo(*curRecording));
}
else if (recgrp == "LiveTV" && pseudoLiveTVRecording)
{
@@ -3332,7 +3341,7 @@ void TVRec::SetRingBuffer(RingBuffer *rb)
}
void TVRec::RingBufferChanged(
- RingBuffer *rb, ProgramInfo *pginfo, RecordingQuality *recq)
+ RingBuffer *rb, RecordingInfo *pginfo, RecordingQuality *recq)
{
LOG(VB_GENERAL, LOG_INFO, LOC + "RingBufferChanged()");
@@ -3747,7 +3756,7 @@ void TVRec::TuningFrequency(const TuningRequest &request)
{
// We need there to be a ringbuffer for these modes
bool ok;
- ProgramInfo *tmp = pseudoLiveTVRecording;
+ RecordingInfo *tmp = pseudoLiveTVRecording;
pseudoLiveTVRecording = NULL;
tvchain->SetCardType("DUMMY");
View
6 mythtv/libs/libmythtv/tv_rec.h
@@ -226,7 +226,7 @@ class MTV_PUBLIC TVRec : public SignalMonitorListener, public QRunnable
/// \brief Returns true is "errored" is true, false otherwise.
bool IsErrored(void) const { return HasFlags(kFlagErrored); }
- void RingBufferChanged(RingBuffer*, ProgramInfo*, RecordingQuality*);
+ void RingBufferChanged(RingBuffer*, RecordingInfo*, RecordingQuality*);
void RecorderPaused(void);
void SetNextLiveTVDir(QString dir);
@@ -246,7 +246,7 @@ class MTV_PUBLIC TVRec : public SignalMonitorListener, public QRunnable
private:
void SetRingBuffer(RingBuffer *);
- void SetPseudoLiveTVRecording(ProgramInfo*);
+ void SetPseudoLiveTVRecording(RecordingInfo*);
void TeardownAll(void);
void WakeEventLoop(void);
@@ -383,7 +383,7 @@ class MTV_PUBLIC TVRec : public SignalMonitorListener, public QRunnable
PendingMap pendingRecordings;
// Pseudo LiveTV recording
- ProgramInfo *pseudoLiveTVRecording;
+ RecordingInfo *pseudoLiveTVRecording;
QString nextLiveTVDir;
QMutex nextLiveTVDirLock;
QWaitCondition triggerLiveTVDir;
Please sign in to comment.
Something went wrong with that request. Please try again.