diff options
-rw-r--r-- | dxr3device.c | 11 | ||||
-rw-r--r-- | dxr3interface.c | 18 | ||||
-rw-r--r-- | dxr3interface.h | 2 |
3 files changed, 23 insertions, 8 deletions
diff --git a/dxr3device.c b/dxr3device.c index ec1d261..a1e3da3 100644 --- a/dxr3device.c +++ b/dxr3device.c @@ -181,6 +181,8 @@ bool cDxr3Device::Poll(cPoller &Poller, int TimeoutMs) //! actually plays the given data block as video int cDxr3Device::PlayVideo(const uchar *Data, int Length) { + static int i = 0; + cDxr3PesFrame frame; frame.parse(Data, Length); uint32_t pts = frame.GetPts(); @@ -195,6 +197,15 @@ int cDxr3Device::PlayVideo(const uchar *Data, int Length) cDxr3Interface::instance()->SetSysClock(vPts); scrSet = true; } + cDxr3Interface::instance()->PlayVideoFrame(&frame, vPts); + + if (i < 7) { + i++; + } + if (i == 7) { + cDxr3Interface::instance()->SetPlayMode(); + i = 8; + } return Length; } diff --git a/dxr3interface.c b/dxr3interface.c index 1c1a392..b04d08e 100644 --- a/dxr3interface.c +++ b/dxr3interface.c @@ -275,10 +275,17 @@ void cDxr3Interface::Pause() } // ================================== -void cDxr3Interface::PlayVideoFrame(cDxr3PesFrame *frame) +void cDxr3Interface::PlayVideoFrame(cDxr3PesFrame *frame, uint32_t pts) { - if (!m_VideoActive) { - return; + //if (!m_VideoActive) { + // return; + //} + + if (pts > 0) { + pts += 45000; + dsyslog("setting pts %d", pts); + this->SetPts(pts); + m_lastSeenPts = pts; } Lock(); @@ -298,10 +305,7 @@ void cDxr3Interface::PlayVideoFrame(cDxr3PesFrame *frame) Unlock(); - SetAspectRatio(frame->GetAspectRatio()); - uint32_t pts = frame->GetPts(); - if (pts > 0) - m_lastSeenPts = pts; + //SetAspectRatio(frame->GetAspectRatio()); } // ================================== diff --git a/dxr3interface.h b/dxr3interface.h index 101fd40..72d3561 100644 --- a/dxr3interface.h +++ b/dxr3interface.h @@ -99,7 +99,7 @@ public: // play functions void SetPlayMode(); void Pause(); - void PlayVideoFrame(cDxr3PesFrame *frame); + void PlayVideoFrame(cDxr3PesFrame *frame, uint32_t pts); // device access void ClaimDevices(); |