summaryrefslogtreecommitdiff
path: root/recman.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'recman.cpp')
-rw-r--r--recman.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/recman.cpp b/recman.cpp
index ca7741a..bf7ca3f 100644
--- a/recman.cpp
+++ b/recman.cpp
@@ -240,24 +240,24 @@ namespace vdrlive {
long RecordingsItemRec::Duration() const
{
- long RecLength = 0;
- if (!m_recording->FileName()) return 0;
- cString filename = cString::sprintf("%s%s", m_recording->FileName(), INDEXFILESUFFIX);
- if (*filename) {
- if (access(filename, R_OK) == 0) {
- struct stat buf;
- if (stat(filename, &buf) == 0) {
- struct tIndex { int offset; uchar type; uchar number; short reserved; };
- int delta = buf.st_size % sizeof(tIndex);
- if (delta) {
- delta = sizeof(tIndex) - delta;
- esyslog("ERROR: invalid file size (%ld) in '%s'", buf.st_size, *filename);
+ long RecLength = 0;
+ if (!m_recording->FileName()) return 0;
+ cString filename = cString::sprintf("%s%s", m_recording->FileName(), INDEXFILESUFFIX);
+ if (*filename) {
+ if (access(filename, R_OK) == 0) {
+ struct stat buf;
+ if (stat(filename, &buf) == 0) {
+ struct tIndex { int offset; uchar type; uchar number; short reserved; };
+ int delta = buf.st_size % sizeof(tIndex);
+ if (delta) {
+ delta = sizeof(tIndex) - delta;
+ esyslog("ERROR: invalid file size (%ld) in '%s'", buf.st_size, *filename);
+ }
+ RecLength = (buf.st_size + delta) / sizeof(tIndex) / SecondsToFrames(60);
+ }
+ }
}
- RecLength = (buf.st_size + delta) / sizeof(tIndex) / SecondsToFrames(60);
- }
- }
- }
- return RecLength;
+ return RecLength;
}
/**