summaryrefslogtreecommitdiff
path: root/p2pvr/lib/recorder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'p2pvr/lib/recorder.cpp')
-rw-r--r--p2pvr/lib/recorder.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/p2pvr/lib/recorder.cpp b/p2pvr/lib/recorder.cpp
index 98c7c4e..bdd18c6 100644
--- a/p2pvr/lib/recorder.cpp
+++ b/p2pvr/lib/recorder.cpp
@@ -47,7 +47,7 @@ Recorder::RefreshSchedules(const Ice::Current &)
auto service = si->GetService(s->ServiceId);
auto event = si->GetEvent(s->ServiceId, s->EventId);
- auto startIn = std::max<time_t>(event->StartTime - schedule->Early - time(NULL), 0);
+ auto startIn = std::max<time_t>((*event->StartTime - *schedule->Early - boost::posix_time::second_clock::universal_time()).total_seconds(), 0);
IceUtil::TimerTaskPtr startTimer = new BindTimerTask(boost::bind(&Recorder::StartRecording, this, schedule, service, event));
timer->schedule(startTimer, IceUtil::Time::seconds(startIn));
pendingRecordings.push_back(startTimer);
@@ -75,11 +75,11 @@ Recorder::StartRecording(P2PVR::SchedulePtr schedule, DVBSI::ServicePtr service,
service->Name ? *service->Name : "<no name>", service->ServiceId);
recordings->NewRecording(new P2PVR::Recording(0, storage->ice_toString(), id, schedule->ScheduleId, event->Title, event->Subtitle,
- event->Description, event->StartTime, event->StopTime - event->StartTime));
+ event->Description, event->StartTime, *(*event->StopTime - *event->StartTime)));
auto newCurrent = CurrentPtr(new Current({muxer, store, ss, schedule, service, event, IceUtil::TimerTaskPtr()}));
currentRecordings.insert(newCurrent);
- auto stopIn = event->StopTime + schedule->Late - time(NULL);
+ auto stopIn = (*event->StopTime + *schedule->Late - boost::posix_time::second_clock::universal_time()).total_seconds();
newCurrent->stopTimer = new BindTimerTask(boost::bind(&Recorder::StopRecording, this, newCurrent));
timer->schedule(newCurrent->stopTimer, IceUtil::Time::seconds(stopIn));
Logger()->messagebf(LOG_DEBUG, "Recording %s scheduled stop in %s seconds", event->Title, stopIn);