summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2014-02-06 11:04:03 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2014-02-06 11:04:03 +0100
commit7d6c54d63a0707409f0a87d2328dd0bf58a30190 (patch)
treef3e184ce2772b7b4ace0464ea4abb1fc71e40dd1
parent719b46b30506a60ca31e75d9fc7db23f36fc9350 (diff)
downloadvdr-7d6c54d63a0707409f0a87d2328dd0bf58a30190.tar.gz
vdr-7d6c54d63a0707409f0a87d2328dd0bf58a30190.tar.bz2
Fixed numbering frames
-rw-r--r--HISTORY7
-rw-r--r--recording.c8
2 files changed, 10 insertions, 5 deletions
diff --git a/HISTORY b/HISTORY
index c016f54b..2a066eb3 100644
--- a/HISTORY
+++ b/HISTORY
@@ -7870,7 +7870,7 @@ Video Disk Recorder Revision History
and also to use the correct directory with --edit (the latter reported by Marko
Mäkelä).
-2014-02-04: Version 2.0.6
+2014-02-06: Version 2.0.6
- Updated 'sources.conf' (thanks to Antti Hartikainen).
- cFont::CreateFont() now returns a dummy font in case there are no fonts installed.
@@ -7889,3 +7889,8 @@ Video Disk Recorder Revision History
directories" is set to "no".
- Fixed clearing non-editable members in the channel editor (thanks to Rolf Ahrenberg).
- Fixed flickering if subtitles are active while the OSD demo is running.
+- Fixed numbering frames. Previously they were numbered starting from 1, while it
+ is apparently standard to number them from 0. Any existing recordings with editing
+ marks (which will now be off by one) can still be cut with all VDR versions from
+ 1.7.32, because these will automatically adjust editing marks to I-frames.
+ Users of stable releases shouldn't notice any problems.
diff --git a/recording.c b/recording.c
index ef3144e2..a35d0ee6 100644
--- a/recording.c
+++ b/recording.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: recording.c 2.91.1.4 2014/01/29 10:50:28 kls Exp $
+ * $Id: recording.c 2.91.1.5 2014/02/06 11:04:03 kls Exp $
*/
#include "recording.h"
@@ -2394,7 +2394,7 @@ cString IndexToHMSF(int Index, bool WithFrame, double FramesPerSecond)
Sign = "-";
}
double Seconds;
- int f = int(modf((Index + 0.5) / FramesPerSecond, &Seconds) * FramesPerSecond + 1);
+ int f = int(modf((Index + 0.5) / FramesPerSecond, &Seconds) * FramesPerSecond);
int s = int(Seconds);
int m = s / 60 % 60;
int h = s / 3600;
@@ -2407,9 +2407,9 @@ int HMSFToIndex(const char *HMSF, double FramesPerSecond)
int h, m, s, f = 1;
int n = sscanf(HMSF, "%d:%d:%d.%d", &h, &m, &s, &f);
if (n == 1)
- return h - 1; // plain frame number
+ return h; // plain frame number
if (n >= 3)
- return int(round((h * 3600 + m * 60 + s) * FramesPerSecond)) + f - 1;
+ return int(round((h * 3600 + m * 60 + s) * FramesPerSecond)) + f;
return 0;
}