From 6b1b1cf7ceeec80ea769e189e48ec302da5d57f2 Mon Sep 17 00:00:00 2001 From: scop Date: Mon, 14 Mar 2005 16:02:16 +0000 Subject: Apply DVB subtitles sync fix from Mikko Tuumanen. --- CONTRIBUTORS | 1 + HISTORY | 1 + dxr3device.c | 2 +- dxr3interface.c | 8 ++++++++ dxr3interface.h | 2 ++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 1074cbe..c173543 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -24,5 +24,6 @@ Lars Neufurth Luca Olivetti Ville Skyttä Peter Dittmann +Mikko Tuumanen Thank you very much :) diff --git a/HISTORY b/HISTORY index 71f87a3..b8bd21b 100644 --- a/HISTORY +++ b/HISTORY @@ -254,3 +254,4 @@ NOTE: I havent found time to include all of the languages, will be done in pre2 - assume SSE support implies MMXEXT support (Ville Skyttä) - avoid hang in pause mode with VDR >= 1.3.18 (Luca Olivetti) - avoid high CPU usage in pause mode (Luca Olivetti, Klaus Schmidinger) +- improved GetSTC(): fixes DVB subtitles sync problems (Mikko Tuumanen) diff --git a/dxr3device.c b/dxr3device.c index 965d2fb..1a5822a 100644 --- a/dxr3device.c +++ b/dxr3device.c @@ -173,7 +173,7 @@ bool cDxr3Device::SetPlayMode(ePlayMode PlayMode) // ================================== int64_t cDxr3Device::GetSTC() { - return cDxr3Interface::Instance().GetSysClock(); + return cDxr3Interface::Instance().GetPts(); } // ================================== diff --git a/dxr3interface.c b/dxr3interface.c index 0a9f847..ec84371 100644 --- a/dxr3interface.c +++ b/dxr3interface.c @@ -315,6 +315,11 @@ uint32_t cDxr3Interface::GetSysClock() const return ret; } +// ================================== +int64_t cDxr3Interface::GetPts() { + return last_seen_pts << 1; +} + // ================================== void cDxr3Interface::SetPts(uint32_t pts) { @@ -622,6 +627,9 @@ void cDxr3Interface::PlayVideoFrame(cFixedLengthFrame* pFrame, int times) Unlock(); SetAspectRatio(pFrame->GetAspectRatio()); + uint32_t pts = pFrame->GetPts(); + if (pts > 0) + last_seen_pts = pts; } } diff --git a/dxr3interface.h b/dxr3interface.h index 0e6a99b..1714715 100644 --- a/dxr3interface.h +++ b/dxr3interface.h @@ -69,6 +69,7 @@ public: uint32_t GetSysClock() const; void SetPts(uint32_t pts); void SetSpuPts(uint32_t pts); + int64_t GetPts(); // state changes void EnableSPU(); @@ -132,6 +133,7 @@ private: int m_fdVideo; ///< filehandle for video fifo of dxr3 card int m_fdAudio; ///< filehandle for audio fifo of dxr3 card int m_fdSpu; ///< filehandle for spu fifo of dxr3 card + uint32_t last_seen_pts; // dxr3 clock cDxr3SysClock* m_pClock; ///< clock used for sync -- cgit v1.2.3