summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
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