From 43a02e8973c7e2b6368b460ffb00bb674717db0a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 May 2015 19:01:00 +0100 Subject: [PATCH] [rbp] Allow settings option for timestamp preference We currently have some files that play better with pts timestamps and some that play better with dts timestamps Provide a gui setting to allow users to adjust this behaviour until we have a better solution --- addons/resource.language.en_gb/resources/strings.po | 10 ++++++++++ system/settings/rbp.xml | 7 +++++++ xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po index 731dd552b24d1..7429b0e8ac09e 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -17432,3 +17432,13 @@ msgstr "" msgctxt "#38121" msgid "This option supports 8 channel DTS HD decoding, but may use more CPU. It is only available when DTS and DTS-HD audio passthrough is disabled" msgstr "" + +#: system/settings/rbp.xml +msgctxt "#38210" +msgid "Prefer PTS timestamps" +msgstr "" + +#: system/settings/rbp.xml +msgctxt "#38211" +msgid "Try enabling this if you have stutter with video files" +msgstr "" diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml index b27d23f1f083a..8c6e69dfd481a 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml @@ -42,6 +42,13 @@ + + + 3 + false + + + diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp index 41cd776ee1be0..6061c6bb40fc5 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp @@ -799,7 +799,7 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) pts = 0; buffer->pts = pts == DVD_NOPTS_VALUE ? MMAL_TIME_UNKNOWN : pts; buffer->dts = dts == DVD_NOPTS_VALUE ? MMAL_TIME_UNKNOWN : dts; - if (buffer->dts != MMAL_TIME_UNKNOWN) buffer->pts = MMAL_TIME_UNKNOWN; + if (buffer->dts != MMAL_TIME_UNKNOWN && !CSettings::Get().GetBool("videoplayer.preferptstimestamps")) buffer->pts = MMAL_TIME_UNKNOWN; buffer->length = demuxer_bytes > buffer->alloc_size ? buffer->alloc_size : demuxer_bytes; // set a flag so we can identify primary frames from generated frames (deinterlace) buffer->flags = MMAL_BUFFER_HEADER_FLAG_USER0; diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp index 5f6b402ee03e0..ce23becb106a6 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -495,7 +495,7 @@ void OMXPlayerVideo::Process() if (pts != DVD_NOPTS_VALUE) pts += m_iVideoDelay; - m_omxVideo.Decode(pPacket->pData, pPacket->iSize, dts, dts == DVD_NOPTS_VALUE ? pts : DVD_NOPTS_VALUE); + m_omxVideo.Decode(pPacket->pData, pPacket->iSize, dts, dts != DVD_NOPTS_VALUE && !CSettings::Get().GetBool("videoplayer.preferptstimestamps") ? DVD_NOPTS_VALUE : pts); if (pts == DVD_NOPTS_VALUE) pts = dts;