diff options
Diffstat (limited to 'dxr3nextpts.h')
-rw-r--r-- | dxr3nextpts.h | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/dxr3nextpts.h b/dxr3nextpts.h index 4d66d0a..3b459d4 100644 --- a/dxr3nextpts.h +++ b/dxr3nextpts.h @@ -23,7 +23,7 @@ #define _DXR3NEXTPTS_H_ #include <unistd.h> -#include <stdint.h> +#include <stdint.h> #include "dxr3vdrincludes.h" #include "dxr3singleton.h" @@ -36,20 +36,43 @@ public: cDxr3NextPts() {} ~cDxr3NextPts() {} - void SetNextPts(uint32_t pts) { Lock(); if (pts) m_nextPts = pts; Unlock(); } - uint32_t GetNextPts() { Lock(); uint32_t tmpPts = m_nextPts; Unlock(); return tmpPts;} + void SetNextPts(uint32_t pts) + { + Lock(); + if (pts) + m_nextPts = pts; + Unlock(); + } + uint32_t GetNextPts() + { + Lock(); + uint32_t tmpPts = m_nextPts; + Unlock(); + return tmpPts; + } + + void Clear() + { + Lock(); + m_nextPts = 0; + Unlock(); + } - void Clear() { Lock(); m_nextPts = 0; Unlock();} - protected: static cMutex* m_pMutex; uint32_t m_nextPts; - static void Lock() {cDxr3NextPts::m_pMutex->Lock();} - static void Unlock() {cDxr3NextPts::m_pMutex->Unlock();} - + static void Lock() + { + cDxr3NextPts::m_pMutex->Lock(); + } + static void Unlock() + { + cDxr3NextPts::m_pMutex->Unlock(); + } + private: - cDxr3NextPts(cDxr3NextPts&); // no copy constructor + cDxr3NextPts(cDxr3NextPts&); // no copy constructor }; #endif /*_DXR3NEXTPTS_H_*/ |