Skip to content

Commit

Permalink
Update to version 0.60
Browse files Browse the repository at this point in the history
Also, made is so that non-monotonic timestamp values automatically get
clamped to the last time value.
  • Loading branch information
jp9000 committed Feb 3, 2014
1 parent 8f126a2 commit edf5765
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
14 changes: 13 additions & 1 deletion OBSApi/OBSApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,19 @@ LPBYTE GetCursorData(HICON hIcon, ICONINFO &ii, UINT &width, UINT &height)
}

extern LARGE_INTEGER clockFreq;
LONGLONG lastQPCTime;
volatile LONGLONG lastQPCTime = 0;

QWORD GetQPCTimeNS()
{
LARGE_INTEGER currentTime;
QueryPerformanceCounter(&currentTime);

if (currentTime.QuadPart < lastQPCTime)
{
Log (TEXT("GetQPCTimeNS: WTF, clock went backwards! %I64d < %I64d"), currentTime.QuadPart, lastQPCTime);
currentTime.QuadPart = lastQPCTime;
}

lastQPCTime = currentTime.QuadPart;

double timeVal = double(currentTime.QuadPart);
Expand All @@ -268,7 +272,11 @@ QWORD GetQPCTime100NS()
QueryPerformanceCounter(&currentTime);

if (currentTime.QuadPart < lastQPCTime)
{
Log (TEXT("GetQPCTime100NS: WTF, clock went backwards! %I64d < %I64d"), currentTime.QuadPart, lastQPCTime);
currentTime.QuadPart = lastQPCTime;
}

lastQPCTime = currentTime.QuadPart;

double timeVal = double(currentTime.QuadPart);
Expand All @@ -284,7 +292,11 @@ QWORD GetQPCTimeMS()
QueryPerformanceCounter(&currentTime);

if (currentTime.QuadPart < lastQPCTime)
{
Log (TEXT("GetQPCTimeMS: WTF, clock went backwards! %I64d < %I64d"), currentTime.QuadPart, lastQPCTime);
currentTime.QuadPart = lastQPCTime;
}

lastQPCTime = currentTime.QuadPart;

QWORD timeVal = currentTime.QuadPart;
Expand Down
3 changes: 3 additions & 0 deletions OBSApi/Utility/XString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,9 @@ String String::Left(UINT iOffset)

String String::Mid(UINT iStart, UINT iEnd)
{
if (!IsValid())
return String();

if( (iStart >= curLength) ||
(iEnd > curLength || iEnd <= iStart) )
{
Expand Down
6 changes: 3 additions & 3 deletions Source/Main.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ extern TCHAR lpAppDataPath[MAX_PATH];
#define OBS_VERSION_SUFFIX ""
#endif

#define OBS_VERSION 0x005902 //version number is 0xMMmmtt (Major.minor.whatever - hex)
#define OBS_VERSION_STRING_RAW "Open Broadcaster Software v0.60b test build 9"
#define OBS_TEST_BUILD 1 //define this if releasing a test build to disable the auto updater
#define OBS_VERSION 0x006000 //version number is 0xMMmmtt (Major.minor.whatever - hex)
#define OBS_VERSION_STRING_RAW "Open Broadcaster Software v0.60b"
//#define OBS_TEST_BUILD 1 //define this if releasing a test build to disable the auto updater

#define OBS_VERSION_STRING_ANSI OBS_VERSION_STRING_RAW OBS_VERSION_SUFFIX
#define OBS_VERSION_STRING TEXT(OBS_VERSION_STRING_RAW) TEXT(OBS_VERSION_SUFFIX)
Expand Down

0 comments on commit edf5765

Please sign in to comment.