From cd447f97099fb494716a7e9c2aad1716f456ba63 Mon Sep 17 00:00:00 2001 From: mrwastl Date: Tue, 4 Oct 2011 23:06:07 +0200 Subject: fixed wrong recordinglength with vdr-1.7.x (thx to copperhead for pointing out this one) --- common.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'common.c') 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; -- cgit v1.2.3