Skip to content

Commit

Permalink
Show correct end time and progress while replaying (Patch provided by…
Browse files Browse the repository at this point in the history
… user

'zimuland' of projects.vdr-developer.de). Closes bugtracker entry #1549.
  • Loading branch information
Dieter Hametner committed Feb 13, 2015
1 parent 31ebc4f commit 3b052e1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
30 changes: 29 additions & 1 deletion epg_events.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <time.h>
#include <glob.h>
#include <algorithm>
#include <vdr/player.h>

#include "tools.h"
#include "recman.h"
Expand Down Expand Up @@ -194,8 +195,35 @@ namespace vdrlive
#if VDRVERSNUM < 10726
return m_recording ? m_recording->start : 0;
#else
return m_recording ? m_recording->Start() : 0;
time_t endTime = 0;
if (m_recording)
{
time_t startTime = m_recording->Start();
int length = m_recording->LengthInSeconds();

endTime = (length < 0) ? startTime : startTime + length;
}
return endTime;
#endif
}

int EpgRecording::Elapsed() const
{
#if VDRVERSNUM >= 10726
cControl* pControl = cControl::Control();
if (pControl)
{
int current, total;
if (pControl->GetIndex(current,total))
{
if (total)
{
return (100 * current) / total;
}
}
}
#endif
return 0;
}

const string EpgRecording::Name() const
Expand Down
2 changes: 2 additions & 0 deletions epg_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ namespace vdrlive

virtual time_t GetEndTime() const;

virtual int Elapsed() const;

private:
const cRecording* m_recording;
bool m_ownCaption;
Expand Down

0 comments on commit 3b052e1

Please sign in to comment.