summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authormrwastl <mrwastl@users.sourceforge.net>2011-10-04 23:06:07 +0200
committermrwastl <mrwastl@users.sourceforge.net>2011-10-04 23:06:07 +0200
commitcd447f97099fb494716a7e9c2aad1716f456ba63 (patch)
treea7cb495a4fd68d5d13ccc0cee96fa561afe00fc5 /common.c
parent2d3832dd913f678f40a748faa4aeb1429bec4df1 (diff)
downloadvdr-plugin-graphlcd-cd447f97099fb494716a7e9c2aad1716f456ba63.tar.gz
vdr-plugin-graphlcd-cd447f97099fb494716a7e9c2aad1716f456ba63.tar.bz2
fixed wrong recordinglength with vdr-1.7.x (thx to copperhead for pointing out this one)
Diffstat (limited to 'common.c')
-rw-r--r--common.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/common.c b/common.c
index 1b73d13..8f1c52a 100644
--- a/common.c
+++ b/common.c
@@ -61,7 +61,7 @@ GLCD::cType TimeType(time_t Time, const std::string &Format)
return false;
}
-GLCD::cType DurationType(int Index, const std::string &Format)
+GLCD::cType DurationType(int Index, const std::string &Format, double framesPerSecFactor = 1.0)
{
static char result[1000];
if (Index > 0)
@@ -73,13 +73,10 @@ GLCD::cType DurationType(int Index, const std::string &Format)
char *res = result;
enum { normal, format } state = normal;
int n = 0;
-#if VDRVERSNUM >= 10701
- int f = (Index % (int)DEFAULTFRAMESPERSECOND) + 1;
- int s = (Index / (int)DEFAULTFRAMESPERSECOND);
-#else
- int f = (Index % FRAMESPERSEC) + 1;
- int s = (Index / FRAMESPERSEC);
-#endif
+
+ int f = (Index % (int)framesPerSecFactor) + 1;
+ int s = (Index / (int)framesPerSecFactor);
+
int m = s / 60 % 60;
int h = s / 3600;
s %= 60;