summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscop <scop>2005-03-14 16:02:16 +0000
committerscop <scop>2005-03-14 16:02:16 +0000
commit6b1b1cf7ceeec80ea769e189e48ec302da5d57f2 (patch)
tree04da26598c95ee8b7ae9ce2e15ddf5903d269981
parente667a90088ce0920ff8a0a88ee0ef09bed757d7a (diff)
downloadvdr-plugin-dxr3-6b1b1cf7ceeec80ea769e189e48ec302da5d57f2.tar.gz
vdr-plugin-dxr3-6b1b1cf7ceeec80ea769e189e48ec302da5d57f2.tar.bz2
Apply DVB subtitles sync fix from Mikko Tuumanen.
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY1
-rw-r--r--dxr3device.c2
-rw-r--r--dxr3interface.c8
-rw-r--r--dxr3interface.h2
5 files changed, 13 insertions, 1 deletions
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
@@ -316,6 +316,11 @@ uint32_t cDxr3Interface::GetSysClock() const
}
// ==================================
+int64_t cDxr3Interface::GetPts() {
+ return last_seen_pts << 1;
+}
+
+// ==================================
void cDxr3Interface::SetPts(uint32_t pts)
{
if (!m_ExternalReleased)
@@ -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