diff options
-rw-r--r-- | dxr3demuxdevice.c | 5 | ||||
-rw-r--r-- | dxr3pesframe.c | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/dxr3demuxdevice.c b/dxr3demuxdevice.c index 26380f7..a0b7325 100644 --- a/dxr3demuxdevice.c +++ b/dxr3demuxdevice.c @@ -214,10 +214,7 @@ int cDxr3DemuxDevice::DemuxPes(const uint8_t* buf, int length, bool bAc3Dts) if (!pesFrame || !pesFrame->parse(buf, length)) { return -1; } -/*TODO: add to pes parser - if (pesFrame.GetPayloadLength() > (uint32_t) VIDEO_MAX_FRAME_SIZE) { - throw (cDxr3PesFrame::PES_GENERAL_ERROR); - };*/ + if (pesFrame->GetPts() != lastPts) { pts = lastPts = pesFrame->GetPts(); } else { diff --git a/dxr3pesframe.c b/dxr3pesframe.c index c0731da..817c51c 100644 --- a/dxr3pesframe.c +++ b/dxr3pesframe.c @@ -24,6 +24,7 @@ #include <linux/em8300.h> #include <vdr/tools.h> +#include "dxr3demuxdevice.h" // ================================== bool cDxr3PesFrame::parse(const uint8_t *pes, uint32_t length) @@ -75,6 +76,14 @@ bool cDxr3PesFrame::parse(const uint8_t *pes, uint32_t length) m_payload = &pes[payloadStart]; m_payloadLength = length - payloadStart; + // check for max sizes supported by syncbuffer + if (m_pesDataType == PES_VIDEO_DATA && m_payloadLength > (uint32_t)VIDEO_MAX_FRAME_SIZE) { + return false; + } + if (m_pesDataType == PES_AUDIO_DATA && m_payloadLength > (uint32_t)AUIDO_MAX_FRAME_SIZE) { + return false; + } + if (m_pesDataType == PES_VIDEO_DATA) { // we can get some informations about the video payload |