Skip to content
Permalink
Browse files

Timers: Use Recordstat-Element to determine real recording start time

  • Loading branch information...
manuelm committed Nov 18, 2018
1 parent 2e94d0c commit 3363bb2cb7a933bd36630f671da05df8f7170c22
Showing with 11 additions and 3 deletions.
  1. +1 −1 src/DvbData.cpp
  2. +1 −1 src/RecordingReader.cpp
  3. +6 −0 src/Timers.cpp
  4. +3 −1 src/Timers.h
@@ -662,7 +662,7 @@ dvbviewer::RecordingReader *Dvb::OpenRecordedStream(const PVR_RECORDING &recinfo
return timer.isRunning(&now, &channelName);
});
if (timer)
startEndTimes = std::make_pair(timer->start, timer->end);
startEndTimes = std::make_pair(timer->realStart, timer->end);
}

return new RecordingReader(url, startEndTimes);
@@ -55,7 +55,7 @@ ssize_t RecordingReader::ReadData(unsigned char *buffer, unsigned int size)
XBMC->SeekFile(m_readHandle, m_pos, SEEK_SET);

// random value (10 MiB) we choose to switch to fast reopen interval
bool nearEnd = m_len - m_pos <= 10 * 1024 * 1024;
bool nearEnd = (m_len - m_pos <= 10 * 1024 * 1024);
m_nextReopen = now + std::chrono::seconds(
nearEnd ? REOPEN_INTERVAL_FAST : REOPEN_INTERVAL);

@@ -528,6 +528,12 @@ Timers::Error Timers::ParseTimerFrom(const TiXmlElement *xml, unsigned int pos,
timer.start = ParseDateTime(startDate, false);
timer.end = timer.start + atoi(xml->Attribute("Dur")) * 60;

if (const auto *stat = xml->FirstChildElement("Recordstat"))
{
startDate = stat->Attribute("StartTime");
timer.realStart = ParseDateTime(startDate, false);
}

xml->QueryUnsignedAttribute("PreEPG", &timer.marginStart);
xml->QueryUnsignedAttribute("PostEPG", &timer.marginEnd);
xml->QueryIntAttribute("Priority", &timer.priority);
@@ -73,8 +73,10 @@ class Timer
unsigned int marginStart = 0;
unsigned int marginEnd = 0;
unsigned int weekdays;
std::time_t realStart = 0; // real start time. only available if timer is running.
// might differ from start if added in the middle of a show

std::string source;
std::string source; // holds autotimer.title if created by an autotimer

PVR_TIMER_STATE state;
SyncState syncState = SyncState::NEW;

0 comments on commit 3363bb2

Please sign in to comment.
You can’t perform that action at this time.