Fixed numbering frames

This commit is contained in:
Klaus Schmidinger 2014-02-06 10:57:45 +01:00
parent 4f1404e991
commit e2f0edd8f6
2 changed files with 10 additions and 5 deletions

View File

@ -8170,7 +8170,7 @@ Video Disk Recorder Revision History
- Fixed a superfluous call to the skin's SetRecording() function after renaming a
recording (reported by Christoph Haubrich).
2014-02-04: Version 2.1.5
2014-02-06: Version 2.1.5
- Now checking whether the primary device actually has a decoder before retuning the
current channel after a change in its parameters. This fixes broken recordings on
@ -8185,3 +8185,8 @@ Video Disk Recorder Revision History
- Updated the Estonian OSD texts (thanks to Arthur Konovalov).
- Further clarified the semantics of cCamSlot::Decrypt().
- 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.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: recording.c 3.14 2014/01/29 10:38:46 kls Exp $
* $Id: recording.c 3.15 2014/02/05 10:08:41 kls Exp $
*/
#include "recording.h"
@ -2923,7 +2923,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;
@ -2936,9 +2936,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;
}