summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common.c5
-rw-r--r--skinconfig.c16
2 files changed, 21 insertions, 0 deletions
diff --git a/common.c b/common.c
index 8b03502..431600a 100644
--- a/common.c
+++ b/common.c
@@ -36,8 +36,13 @@ 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 % DEFAULTFRAMESPERSECOND) + 1;
+ int s = (Index / DEFAULTFRAMESPERSECOND);
+#else
int f = (Index % FRAMESPERSEC) + 1;
int s = (Index / FRAMESPERSEC);
+#endif
int m = s / 60 % 60;
int h = s / 3600;
s %= 60;
diff --git a/skinconfig.c b/skinconfig.c
index 423429d..9e4b2ce 100644
--- a/skinconfig.c
+++ b/skinconfig.c
@@ -359,13 +359,25 @@ GLCD::cType cGraphLCDSkinConfig::GetToken(const GLCD::tSkinToken & Token)
case tokPresentEndDateTime:
return TimeType(event.startTime + event.duration, Token.Attrib.Text);
case tokPresentDuration:
+#if VDRVERSNUM >= 10701
+ return DurationType(event.duration * DEFAULTFRAMESPERSECOND, Token.Attrib.Text);
+#else
return DurationType(event.duration * FRAMESPERSEC, Token.Attrib.Text);
+#endif
case tokPresentProgress:
+#if VDRVERSNUM >= 10701
+ return DurationType((time(NULL) - event.startTime) * DEFAULTFRAMESPERSECOND, Token.Attrib.Text);
+#else
return DurationType((time(NULL) - event.startTime) * FRAMESPERSEC, Token.Attrib.Text);
+#endif
case tokPresentRemaining:
if ((time(NULL) - event.startTime) < event.duration)
{
+#if VDRVERSNUM >= 10701
+ return DurationType((event.duration - (time(NULL) - event.startTime)) * DEFAULTFRAMESPERSECOND, Token.Attrib.Text);
+#else
return DurationType((event.duration - (time(NULL) - event.startTime)) * FRAMESPERSEC, Token.Attrib.Text);
+#endif
}
return false;
case tokPresentTitle:
@@ -392,7 +404,11 @@ GLCD::cType cGraphLCDSkinConfig::GetToken(const GLCD::tSkinToken & Token)
case tokFollowingEndDateTime:
return TimeType(event.startTime + event.duration, Token.Attrib.Text);
case tokFollowingDuration:
+#if VDRVERSNUM >= 10701
+ return DurationType(event.duration * DEFAULTFRAMESPERSECOND, Token.Attrib.Text);
+#else
return DurationType(event.duration * FRAMESPERSEC, Token.Attrib.Text);
+#endif
case tokFollowingTitle:
return event.title;
case tokFollowingShortText: