From f8210be1af80d0a7ef27a5408a71a055216d1b7a Mon Sep 17 00:00:00 2001 From: scop Date: Sat, 28 May 2005 10:40:00 +0000 Subject: Improve recovery and avoid lockups with bad streams (Jon Burgess). --- dxr3demuxdevice.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dxr3demuxdevice.c') diff --git a/dxr3demuxdevice.c b/dxr3demuxdevice.c index 6dc7292..6523768 100644 --- a/dxr3demuxdevice.c +++ b/dxr3demuxdevice.c @@ -388,6 +388,9 @@ int cDxr3DemuxDevice::DemuxPes(const uint8_t* buf, int length, bool bAc3Dts) m_dxr3Device.SetVerticalSize(pesFrame.GetVerticalSize()); while (!Poll(100)); cFixedLengthFrame* pTempFrame = m_vBuf.Push(pesFrame.GetEsStart(), (int) (pesFrame.GetEsLength()), pts, ftVideo); + if (!pTempFrame) /* Push Timeout */ + throw (cDxr3PesFrame::PES_GENERAL_ERROR); + pTempFrame->SetAspectRatio(pesFrame.GetAspectRatio()); m_aBuf.WakeUp(); @@ -414,6 +417,9 @@ int cDxr3DemuxDevice::DemuxPes(const uint8_t* buf, int length, bool bAc3Dts) m_dxr3Device.SetHorizontalSize(pesFrame.GetHorizontalSize()); m_dxr3Device.SetVerticalSize(pesFrame.GetVerticalSize()); cFixedLengthFrame* pTempFrame = m_vBuf.Push(pesFrame.GetEsStart(), (int) (pesFrame.GetEsLength()), pts, ftVideo); + if (!pTempFrame) /* Push Timeout */ + throw (cDxr3PesFrame::PES_GENERAL_ERROR); + pTempFrame->SetAspectRatio(pesFrame.GetAspectRatio()); if (m_synchState == DXR3_DEMUX_AUDIO_SYNCHED) -- cgit v1.2.3