summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Reufer <thomas@reufer.ch>2016-01-06 07:45:56 +0100
committerThomas Reufer <thomas@reufer.ch>2016-01-06 07:45:56 +0100
commit5f28243de7b1a5e4d882bc9609080d768e55fcf5 (patch)
treea5f347544c7a7050f7b362d8d560c152dec6266e
parenta5d2f886741aa552c1df2b733a473059a5c20d57 (diff)
downloadvdr-plugin-rpihddevice-5f28243de7b1a5e4d882bc9609080d768e55fcf5.tar.gz
vdr-plugin-rpihddevice-5f28243de7b1a5e4d882bc9609080d768e55fcf5.tar.bz2
ignore pts from erroneous packets to avoid pts jumps on broken streams
-rw-r--r--HISTORY1
-rw-r--r--omxdevice.c13
2 files changed, 9 insertions, 5 deletions
diff --git a/HISTORY b/HISTORY
index 488ed01..9c9a2b9 100644
--- a/HISTORY
+++ b/HISTORY
@@ -4,6 +4,7 @@ VDR Plugin 'rpihddevice' Revision History
- new:
- add option for dual display usage, see README
- fixed:
+ - ignore pts from erroneous packets to avoid pts jumps on broken streams
- use omxplayer's parameters for deinterlacer
2015-10-18: Version 1.0.0
diff --git a/omxdevice.c b/omxdevice.c
index 2771ec5..616c449 100644
--- a/omxdevice.c
+++ b/omxdevice.c
@@ -334,16 +334,19 @@ int cOmxDevice::PlayVideo(const uchar *Data, int Length, bool EndOfFrame)
m_mutex->Lock();
int ret = Length;
- int64_t pts = PesHasPts(Data) ? PesGetPts(Data) : OMX_INVALID_PTS;
+
+ cVideoCodec::eCodec codec = ParseVideoCodec(Data + PesPayloadOffset(Data),
+ Length - PesPayloadOffset(Data));
+
+ int64_t pts = PesHasPts(Data) && codec != cVideoCodec::eInvalid ?
+ PesGetPts(Data) : OMX_INVALID_PTS;
if (!m_hasVideo && pts != OMX_INVALID_PTS &&
m_videoCodec == cVideoCodec::eInvalid)
{
- m_videoCodec = ParseVideoCodec(Data + PesPayloadOffset(Data),
- Length - PesPayloadOffset(Data));
-
- if (m_videoCodec != cVideoCodec::eInvalid)
+ if (codec != cVideoCodec::eInvalid)
{
+ m_videoCodec = codec;
if (cRpiSetup::IsVideoCodecSupported(m_videoCodec))
{
m_omx->SetVideoCodec(m_videoCodec);