summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2009-04-19 21:04:39 (GMT)
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2009-04-19 21:04:39 (GMT)
commit46ed54bc095a899bc6fe93fe727e12e96392cc0e (patch)
tree9935f29acf9f16a6f7bfe165d8d5fffd18f93bf1
parent007c4fbed9c0705b3e846ea48f9738c502fbc279 (diff)
downloadvdr-plugin-live-46ed54bc095a899bc6fe93fe727e12e96392cc0e.tar.gz
vdr-plugin-live-46ed54bc095a899bc6fe93fe727e12e96392cc0e.tar.bz2
Calculate right length for TS recordings.cvs-commit-361
This is a patch submitted by jowi24. Newer development versions of VDR create TS recordings. There was no support for such recordings in LIVE yet. length calculation with the new TS recordings introduced wit
-rw-r--r--recman.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/recman.cpp b/recman.cpp
index bf7ca3f..8bfccab 100644
--- a/recman.cpp
+++ b/recman.cpp
@@ -242,6 +242,7 @@ namespace vdrlive {
{
long RecLength = 0;
if (!m_recording->FileName()) return 0;
+#if VDRVERSNUM < 10704
cString filename = cString::sprintf("%s%s", m_recording->FileName(), INDEXFILESUFFIX);
if (*filename) {
if (access(filename, R_OK) == 0) {
@@ -257,6 +258,14 @@ namespace vdrlive {
}
}
}
+#else
+ // open index file for reading only
+ cIndexFile *index = new cIndexFile(m_recording->FileName(), false, m_recording->IsPesRecording());
+ if (index && index->Ok()) {
+ RecLength = (int) (index->Last() / SecondsToFrames(60, m_recording->FramesPerSecond()));
+ }
+ delete index;
+#endif
return RecLength;
}