summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY2
-rw-r--r--dvbplayer.c5
-rw-r--r--menu.c7
-rw-r--r--recording.c6
4 files changed, 12 insertions, 8 deletions
diff --git a/HISTORY b/HISTORY
index 25241902..ffdfa80c 100644
--- a/HISTORY
+++ b/HISTORY
@@ -5956,3 +5956,5 @@ Video Disk Recorder Revision History
the actual pids of the channel.
- Fixed cDevice::PlayTsAudio() and made cDevice::PlayTsVideo() return 0 if
PlayVideo() didn't play anything.
+- Added an 'int' typecast to calculations involving FramesPerSecond() to avoid
+ compiler warnings.
diff --git a/dvbplayer.c b/dvbplayer.c
index 9de7e486..9e3cd2fd 100644
--- a/dvbplayer.c
+++ b/dvbplayer.c
@@ -4,10 +4,11 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbplayer.c 2.1 2009/01/05 16:52:40 kls Exp $
+ * $Id: dvbplayer.c 2.2 2009/01/24 11:42:07 kls Exp $
*/
#include "dvbplayer.h"
+#include <math.h>
#include <stdlib.h>
#include "recording.h"
#include "remux.h"
@@ -347,7 +348,7 @@ bool cDvbPlayer::Save(void)
if (index) {
int Index = writeIndex;
if (Index >= 0) {
- Index -= RESUMEBACKUP * framesPerSecond;
+ Index -= int(round(RESUMEBACKUP * framesPerSecond));
if (Index > 0)
Index = index->GetNextIFrame(Index, false);
else
diff --git a/menu.c b/menu.c
index beb7fb87..7e05703d 100644
--- a/menu.c
+++ b/menu.c
@@ -4,12 +4,13 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 2.4 2009/01/06 14:34:17 kls Exp $
+ * $Id: menu.c 2.5 2009/01/24 11:42:24 kls Exp $
*/
#include "menu.h"
#include <ctype.h>
#include <limits.h>
+#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -4170,8 +4171,8 @@ void cReplayControl::TimeSearchProcess(eKeys Key)
{
#define STAY_SECONDS_OFF_END 10
int Seconds = (timeSearchTime >> 24) * 36000 + ((timeSearchTime & 0x00FF0000) >> 16) * 3600 + ((timeSearchTime & 0x0000FF00) >> 8) * 600 + (timeSearchTime & 0x000000FF) * 60;
- int Current = (lastCurrent / FramesPerSecond());
- int Total = (lastTotal / FramesPerSecond());
+ int Current = int(round(lastCurrent / FramesPerSecond()));
+ int Total = int(round(lastTotal / FramesPerSecond()));
switch (Key) {
case k0 ... k9:
if (timeSearchPos < 4) {
diff --git a/recording.c b/recording.c
index 4d60c17c..5dc1b308 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.6 2009/01/18 11:02:09 kls Exp $
+ * $Id: recording.c 2.7 2009/01/24 11:31:16 kls Exp $
*/
#include "recording.h"
@@ -1698,7 +1698,7 @@ cString IndexToHMSF(int Index, bool WithFrame, double FramesPerSecond)
{
char buffer[16];
double Seconds;
- int f = modf((Index + 0.5) / FramesPerSecond, &Seconds) * FramesPerSecond + 1;
+ int f = int(modf((Index + 0.5) / FramesPerSecond, &Seconds) * FramesPerSecond + 1);
int s = int(Seconds);
int m = s / 60 % 60;
int h = s / 3600;
@@ -1720,7 +1720,7 @@ int HMSFToIndex(const char *HMSF, double FramesPerSecond)
int SecondsToFrames(int Seconds, double FramesPerSecond)
{
- return round(Seconds * FramesPerSecond);
+ return int(round(Seconds * FramesPerSecond));
}
// --- ReadFrame -------------------------------------------------------------