diff options
author | austriancoder <austriancoder> | 2004-08-05 23:05:21 +0000 |
---|---|---|
committer | austriancoder <austriancoder> | 2004-08-05 23:05:21 +0000 |
commit | c47666d42f7972e1b51f9de61ce0fa27c72f3127 (patch) | |
tree | e34a87e37901b7f892fb6f330ccb15bcba30039b /dxr3sysclock.c | |
download | vdr-plugin-dxr3-c47666d42f7972e1b51f9de61ce0fa27c72f3127.tar.gz vdr-plugin-dxr3-c47666d42f7972e1b51f9de61ce0fa27c72f3127.tar.bz2 |
initial import
Diffstat (limited to 'dxr3sysclock.c')
-rw-r--r-- | dxr3sysclock.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/dxr3sysclock.c b/dxr3sysclock.c new file mode 100644 index 0000000..9d7d050 --- /dev/null +++ b/dxr3sysclock.c @@ -0,0 +1,49 @@ +#include <sys/ioctl.h> +#include "dxr3sysclock.h" + +// ================================== +void cDxr3SysClock::SetSysClock(uint32_t scr) +{ + uint32_t sc; + + mutex.Lock(); + ioctl(m_fdcontrol, EM8300_IOCTL_SCR_GET, &sc); + m_offset = scr - sc; + mutex.Unlock(); +} + +// ================================== +uint32_t cDxr3SysClock::GetSysClock(void) +{ + uint32_t sc; + uint32_t retval; + + mutex.Lock(); + ioctl(m_fdcontrol, EM8300_IOCTL_SCR_GET, &sc); + retval = sc + m_offset; + mutex.Unlock(); + + return retval; +} + +// ================================== +void cDxr3SysClock::SetPts(uint32_t pts) +{ + uint32_t newPts = 0; + + mutex.Lock(); + newPts = pts - m_offset; + ioctl(m_fdvideo, EM8300_IOCTL_VIDEO_SETPTS, &newPts); + mutex.Unlock(); +} + +// ================================== +void cDxr3SysClock::SetSpuPts(uint32_t pts) +{ + uint32_t newPts = 0; + + mutex.Lock(); + newPts = (pts - m_offset) << 1; // fix for DVD subtitles + ioctl(m_fdspu, EM8300_IOCTL_SPU_SETPTS, &newPts); + mutex.Unlock(); +} |