diff options
author | mrwastl <mrwastl@users.sourceforge.net> | 2011-10-04 23:06:07 +0200 |
---|---|---|
committer | mrwastl <mrwastl@users.sourceforge.net> | 2011-10-04 23:06:07 +0200 |
commit | cd447f97099fb494716a7e9c2aad1716f456ba63 (patch) | |
tree | a7cb495a4fd68d5d13ccc0cee96fa561afe00fc5 /common.c | |
parent | 2d3832dd913f678f40a748faa4aeb1429bec4df1 (diff) | |
download | vdr-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.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -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; |