[vdr] [Patch] Public access to cRecording::fileSizeMB

Udo Richter udo_richter at gmx.de
Sun Apr 16 16:13:00 CEST 2006


Hi Klaus,

The attached patch provides public access to cRecording::fileSizeMB by 
adding a function cRecording::FileSizeMB(). The size is calculated if it 
is still unknown.
Please consider adding the patch to VDR. The patch shouldn't have any 
negative side effects and might be useful to others.

Cheers,

Udo

-------------- next part --------------
--- vdr-1.3.46-orig/recording.h	2006-04-16 15:35:32.341839992 +0200
+++ vdr-1.3.46/recording.h	2006-04-16 15:35:36.436217552 +0200
@@ -87,6 +87,7 @@
   const char *Title(char Delimiter = ' ', bool NewIndicator = false, int Level = -1) const;
   const cRecordingInfo *Info(void) const { return info; }
   const char *PrefixFileName(char Prefix);
+  int FileSizeMB();
   int HierarchyLevels(void) const;
   void ResetResume(void) const;
   bool IsNew(void) const { return GetResume() <= 0; }
--- vdr-1.3.46-orig/recording.c	2006-04-16 15:35:28.444432488 +0200
+++ vdr-1.3.46/recording.c	2006-04-16 15:35:40.708568056 +0200
@@ -762,6 +762,13 @@
   return NULL;
 }
 
+int cRecording::FileSizeMB()
+{
+  if (fileSizeMB < 0)
+     fileSizeMB = DirSizeMB(FileName());
+  return fileSizeMB;
+}
+
 int cRecording::HierarchyLevels(void) const
 {
   const char *s = name;



More information about the vdr mailing list