summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dxr3demuxdevice.c9
-rw-r--r--dxr3interface.c12
-rw-r--r--dxr3interface.h15
3 files changed, 17 insertions, 19 deletions
diff --git a/dxr3demuxdevice.c b/dxr3demuxdevice.c
index 4f1dbe8..407cde2 100644
--- a/dxr3demuxdevice.c
+++ b/dxr3demuxdevice.c
@@ -260,8 +260,7 @@ int cDxr3DemuxDevice::DemuxPes(const uint8_t* buf, int length, bool bAc3Dts)
bPlaySuc = true;
//if (bPlayedFrame) return length;
bPlayedFrame = true;
- m_dxr3Device->SetHorizontalSize(pesFrame->GetHorizontalSize());
- m_dxr3Device->SetVerticalSize(pesFrame->GetVerticalSize());
+ m_dxr3Device->setDimension(pesFrame->GetHorizontalSize(), pesFrame->GetVerticalSize());
m_dxr3Device->PlayVideoFrame(pesFrame->GetPayload(), pesFrame->GetPayloadLength(), m_ReUseFrame);
break;
@@ -287,8 +286,7 @@ int cDxr3DemuxDevice::DemuxPes(const uint8_t* buf, int length, bool bAc3Dts)
} else if (m_synchState == DXR3_DEMUX_VIDEO_SYNCHED ||
m_synchState == DXR3_DEMUX_SYNCHED) {
- m_dxr3Device->SetHorizontalSize(pesFrame->GetHorizontalSize());
- m_dxr3Device->SetVerticalSize(pesFrame->GetVerticalSize());
+ m_dxr3Device->setDimension(pesFrame->GetHorizontalSize(), pesFrame->GetVerticalSize());
while (!Poll(100)) {}
cFixedLengthFrame* pTempFrame = m_vBuf.Push(pesFrame->GetPayload(), (int) (pesFrame->GetPayloadLength()), pts, ftVideo);
@@ -314,8 +312,7 @@ int cDxr3DemuxDevice::DemuxPes(const uint8_t* buf, int length, bool bAc3Dts)
if (pesFrame->GetFrameType() == I_FRAME) {
vPts = pts;
- m_dxr3Device->SetHorizontalSize(pesFrame->GetHorizontalSize());
- m_dxr3Device->SetVerticalSize(pesFrame->GetVerticalSize());
+ m_dxr3Device->setDimension(pesFrame->GetHorizontalSize(), pesFrame->GetVerticalSize());
cFixedLengthFrame* pTempFrame = m_vBuf.Push(pesFrame->GetPayload(), (int) (pesFrame->GetPayloadLength()), pts, ftVideo);
// TODO: rework me
//if (!pTempFrame) /* Push Timeout */
diff --git a/dxr3interface.c b/dxr3interface.c
index 99684ad..64bdb91 100644
--- a/dxr3interface.c
+++ b/dxr3interface.c
@@ -259,6 +259,18 @@ void cDxr3Interface::SetAspectRatio(uint32_t ratio)
Unlock();
}
+
+void cDxr3Interface::setDimension(uint32_t horizontal, uint32_t vertical)
+{
+ if (horizontal > 0) {
+ m_horizontal = horizontal;
+ }
+
+ if (vertical > 0) {
+ m_vertical = vertical;
+ }
+}
+
// play functions
// ==================================
//! set playing mode and start sync engine
diff --git a/dxr3interface.h b/dxr3interface.h
index fe6a705..ba5e3f1 100644
--- a/dxr3interface.h
+++ b/dxr3interface.h
@@ -52,8 +52,7 @@ private:
driver and so to the card,
so this is the layer between plugin and driver.
*/
-class cDxr3Interface : public Singleton<cDxr3Interface>
-{
+class cDxr3Interface : public Singleton<cDxr3Interface> {
public:
cDxr3Interface();
~cDxr3Interface();
@@ -104,17 +103,7 @@ public:
uint32_t GetHorizontalSize() const { return m_horizontal; }
uint32_t GetVerticalSize() const { return m_vertical; }
- void SetHorizontalSize(uint32_t value)
- {
- if (value > 0)
- m_horizontal = value;
- }
-
- void SetVerticalSize(uint32_t value)
- {
- if (value > 0)
- m_vertical = value;
- };
+ void setDimension(uint32_t horizontal, uint32_t vertical);
// play functions
void SetPlayMode();