{
return instance;
}
+
+hmsf Video::framesToHMSF(ULONG frames)
+{
+ hmsf ret;
+
+ if (format == NTSC)
+ {
+ ret.hours = frames / 108000;
+ frames %= 108000;
+ ret.minutes = frames / 1800;
+ frames %= 1800;
+ ret.seconds = frames / 30;
+ ret.frames = frames % 30;
+ }
+ else
+ {
+ ret.hours = frames / 90000;
+ frames %= 90000;
+ ret.minutes = frames / 1500;
+ frames %= 1500;
+ ret.seconds = frames / 25;
+ ret.frames = frames % 25;
+ }
+ return ret;
+}
#include "defines.h"
#include "draintarget.h"
+typedef struct _hmsf
+{
+ UINT hours;
+ UINT minutes;
+ UINT seconds;
+ UINT frames;
+} hmsf;
+
class Video: public DrainTarget
{
public:
UINT getScreenHeight() { return screenHeight; }
UCHAR getTVsize() { return tvsize; }
+ hmsf framesToHMSF(ULONG frames);
+
// Video formats - AV_SET_VID_DISP_FMT
const static UCHAR NTSC = 0;
const static UCHAR PAL = 1;
int cseconds = currentTS - (chours * 3600) - (cminutes * 60);
ULONG endTS = (player->getEndTS() / 90000);
- int ehours = endTS / 3600;
- int eminutes = (endTS - (ehours * 3600)) / 60;
- int eseconds = endTS - (ehours * 3600) - (eminutes * 60);
+// int ehours = endTS / 3600;
+// int eminutes = (endTS - (ehours * 3600)) / 60;
+// int eseconds = endTS - (ehours * 3600) - (eminutes * 60);
+
+ hmsf endHMSF = player->getEndHMSF();
char buffer[100];
if ((currentTS > 95441) // it's at the 33bit rollover point where the calc doesn't work because of the 1s diff
// between demuxer values and video chip return values ... ?
- || (!endTS)) // No values yet
+ || (!endTS) ) // No values yet
{
strcpy(buffer, "-:--:-- / -:--:--");
}
else
{
- SNPRINTF(buffer, 99, "%01i:%02i:%02i / %01i:%02i:%02i", chours, cminutes, cseconds, ehours, eminutes, eseconds);
+ SNPRINTF(buffer, 99, "%01i:%02i:%02i / %01i:%02i:%02i", chours, cminutes, cseconds, endHMSF.hours, endHMSF.minutes, endHMSF.seconds);
logger->log("VVideoRec", Log::DEBUG, buffer);
-
-// if (chours > 0) abort();
}
drawText(buffer, clocksRegion.x, clocksRegion.y, Colour::LIGHTTEXT);