summaryrefslogtreecommitdiff
path: root/display.c
diff options
context:
space:
mode:
authorandreas 'randy' weinberger <vdr@smue.org>2010-11-14 13:51:14 +0100
committerandreas 'randy' weinberger <vdr@smue.org>2010-11-14 13:51:14 +0100
commitc97517dfd803ab7132412725e91241fcca36cbe0 (patch)
tree55d96a5205406505d82ce2b40868186f1cf34840 /display.c
parent97aa570b797460a599696cc22801e968015a5be4 (diff)
downloadvdr-plugin-graphlcd-c97517dfd803ab7132412725e91241fcca36cbe0.tar.gz
vdr-plugin-graphlcd-c97517dfd803ab7132412725e91241fcca36cbe0.tar.bz2
wrong recordinglength with vdr-1.7.x
see http://projects.vdr-developer.org/issues/443 & http://www.vdrportal.de/board/thread.php?postid=955543#post955543
Diffstat (limited to 'display.c')
-rw-r--r--display.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/display.c b/display.c
index a02c7a4..58cc0e0 100644
--- a/display.c
+++ b/display.c
@@ -389,8 +389,8 @@ void cGraphLCDDisplay::Action(void)
{
// but only, if something has changed
#if VDRVERSNUM >= 10701
- if (replay.total / DEFAULTFRAMESPERSECOND != replay.totalLast / DEFAULTFRAMESPERSECOND ||
- replay.current / DEFAULTFRAMESPERSECOND != replay.currentLast / DEFAULTFRAMESPERSECOND ||
+ if (replay.total / replay.framesPerSecond != replay.totalLast / replay.framesPerSecond ||
+ replay.current / replay.framesPerSecond != replay.currentLast / replay.framesPerSecond ||
CurrTime/60 != LastTime/60 ||
update)
#else
@@ -1344,24 +1344,15 @@ void cGraphLCDDisplay::DisplayProgramme()
}
}
-bool cGraphLCDDisplay::IndexIsGreaterAsOneHour(int Index) const
+bool cGraphLCDDisplay::IndexIsGreaterAsOneHour(int Index, double framesPerSecond) const
{
-#if VDRVERSNUM >= 10701
- int h = (Index / DEFAULTFRAMESPERSECOND) / 3600;
-#else
- int h = (Index / FRAMESPERSEC) / 3600;
-#endif
- return h > 0;
+ return (((Index / framesPerSecond) / 3600) > 0);
}
-const char * cGraphLCDDisplay::IndexToMS(int Index) const
+const char * cGraphLCDDisplay::IndexToMS(int Index, double framesPerSecond) const
{
static char buffer[16];
-#if VDRVERSNUM >= 10701
- int s = (Index / DEFAULTFRAMESPERSECOND);
-#else
- int s = (Index / FRAMESPERSEC);
-#endif
+ int s = (Index / framesPerSecond);
int m = s / 60;
s %= 60;
snprintf(buffer, sizeof(buffer), "%02d:%02d", m, s);
@@ -1540,19 +1531,19 @@ void cGraphLCDDisplay::DisplayReplay(tReplayState & replay)
}
else
{
- if ((replay.total > 1 && IndexIsGreaterAsOneHour(replay.total)) ||
- IndexIsGreaterAsOneHour(replay.current)) // Check if any index bigger as one hour
+ if ((replay.total > 1 && IndexIsGreaterAsOneHour(replay.total, replay.framesPerSecond)) ||
+ IndexIsGreaterAsOneHour(replay.current, replay.framesPerSecond)) // Check if any index bigger as one hour
{
- szCurrent = (const char *) IndexToHMSF(replay.current);
+ szCurrent = (const char *) IndexToHMSF(replay.current, replay.framesPerSecond);
if (replay.total > 1) // Don't draw totaltime for endless streams
- szTotal = (const char *) IndexToHMSF(replay.total);
+ szTotal = (const char *) IndexToHMSF(replay.total, replay.framesPerSecond);
}
else
{
// Show only minutes and seconds on short replays
- szCurrent = (const char *) IndexToMS(replay.current);
+ szCurrent = (const char *) IndexToMS(replay.current, replay.framesPerSecond);
if (replay.total > 1) // Don't draw totaltime for endless streams
- szTotal = (const char *) IndexToMS(replay.total);
+ szTotal = (const char *) IndexToMS(replay.total, replay.framesPerSecond);
}
}
// Get width of drawable strings