summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authorAndreas Brugger <brougs78@gmx.net>2006-02-04 11:49:02 +0100
committerThomas Günther <tom@toms-cafe.de>2009-06-03 02:58:17 +0200
commitc1bf83aec2961a4e84dbc1c36042bd985f044a91 (patch)
tree6ce0edea2a8cdf3e83ee897022f85261c6c15407 /common.c
parentdaad17454a344d50150850fd9b9062b200982140 (diff)
downloadvdr-plugin-text2skin-c1bf83aec2961a4e84dbc1c36042bd985f044a91.tar.gz
vdr-plugin-text2skin-c1bf83aec2961a4e84dbc1c36042bd985f044a91.tar.bz2
2006-02-04: Version 1.1-cvs_ext-0.7 (vdr-text2skin-1.1-cvs_ext-0.7.diff)
- changed the routines to determine the next timers - added the possibility to have a scrollbar in every menu - not fully implemented yet (to position in menu-lists is not necessarily correct, if there are more items with the same osd-text)
Diffstat (limited to 'common.c')
-rw-r--r--common.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/common.c b/common.c
index 904c417..b9e1daf 100644
--- a/common.c
+++ b/common.c
@@ -121,6 +121,14 @@ const cRecording *GetRecordingByFileName(const char *FileName)
}
int GetRecordingSize(const char *FileName)
+#if VDRVERSNUM >= 10338
+// use VDR's routine
+{
+ const cRecording *rec = GetRecordingByFileName(FileName);
+ return (rec) ? DirSizeMB(FileName) : 0;
+}
+#else
+// use our own approach
{
if (FileName != NULL) {
bool bRet=false;
@@ -165,6 +173,7 @@ int GetRecordingSize(const char *FileName)
return 0;
}
}
+#endif
int GetRecordingLength(const char *FileName)
{
@@ -217,27 +226,9 @@ int GetRecordingCuttedLength(const char *FileName)
double length = 0;
int totalLength = GetRecordingLength(FileName);
const double diffIFrame = FRAMESPERSEC / 2; // approx. 1/2 sec.
- /*
- // not useful
- static std::string lastFileName = "";
- static uint64 nextUpdate = 0;
- static int totalLength = 0;
- const uint64 bufferTime = 30 * 1000; // [ms]
- */
-
marks.Load(FileName);
- /*
- // buffer the result of 'GetRecordingLength'
- if (FileName != lastFileName || time_ms() >= nextUpdate)
- {
- lastFileName = FileName;
- nextUpdate = time_ms() + bufferTime;
- totalLength = GetRecordingLength(FileName);
- }
- */
-
if (marks.Count())
{
int start = 1; // first frame