Skip to content

Commit

Permalink
[rbp] Allow settings option for timestamp preference
Browse files Browse the repository at this point in the history
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
  • Loading branch information
popcornmix committed Jul 21, 2015
1 parent 39f7855 commit 43a02e8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
10 changes: 10 additions & 0 deletions addons/resource.language.en_gb/resources/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
7 changes: 7 additions & 0 deletions system/settings/rbp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
<control type="toggle" />
</setting>
</group>
<group id="3">
<setting id="videoplayer.preferptstimestamps" type="boolean" label="38210" help="38211">
<level>3</level>
<default>false</default>
<control type="toggle" />
</setting>
</group>
</category>
<category id="myvideos">
<group id="1">
Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/omxplayer/OMXPlayerVideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 43a02e8

Please sign in to comment.