Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[rbp/omxplayer] fixed wrong subtitle offset

  • Loading branch information...
commit 0957f2271d81ab6ab4792cb3122af66871663f35 1 parent 306189c
huceke huceke authored
4 xbmc/cores/omxplayer/OMXPlayer.cpp
View
@@ -3708,7 +3708,7 @@ bool COMXPlayer::GetCurrentSubtitle(CStdString& strSubtitle)
if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD))
return false;
- double pts = m_av_clock.OMXMediaTime(false);
+ double pts = m_av_clock.OMXMediaTime(false, false);
m_player_subtitle.GetCurrentSubtitle(strSubtitle, pts - m_player_video.GetSubtitleDelay());
@@ -3869,7 +3869,7 @@ void COMXPlayer::UpdatePlayState(double timeout)
// TODO : workaround until omx clock handling is rewritten
if(m_playSpeed == DVD_PLAYSPEED_NORMAL)
- state.time = DVD_TIME_TO_MSEC(m_av_clock.OMXMediaTime(true));
+ state.time = DVD_TIME_TO_MSEC(m_av_clock.OMXMediaTime(true, true));
else
state.time = DVD_TIME_TO_MSEC(m_av_clock.GetClock() + m_offset_pts);
state.time_total = m_pDemuxer->GetStreamLength();
4 xbmc/linux/OMXClock.cpp
View
@@ -711,7 +711,7 @@ double OMXClock::OMXWallTime(bool lock /* = true */)
return pts;
}
-double OMXClock::OMXMediaTime(bool lock /* = true */)
+double OMXClock::OMXMediaTime(bool fixPreroll /* true */ , bool lock /* = true */)
{
if(m_omx_clock.GetComponent() == NULL)
return 0;
@@ -737,7 +737,7 @@ double OMXClock::OMXMediaTime(bool lock /* = true */)
pts = FromOMXTime(timeStamp.nTimestamp);
- if(pts != 0.0f)
+ if(pts != 0.0f && fixPreroll)
pts += (OMX_PRE_ROLL * 1000);
if(lock)
2  xbmc/linux/OMXClock.h
View
@@ -115,7 +115,7 @@ class OMXClock
bool OMXStart(bool lock = true);
bool OMXReset(bool lock = true);
double OMXWallTime(bool lock = true);
- double OMXMediaTime(bool lock = true);
+ double OMXMediaTime(bool fixPreroll = true, bool lock = true);
bool OMXPause(bool lock = true);
bool OMXResume(bool lock = true);
bool OMXUpdateClock(double pts, bool lock = true);

1 comment on commit 0957f22

rbej

This patch shorted time displayed subtitles. Please reverted. Better liltle out of sync subs than too short time displayed subs.

Please sign in to comment.
Something went wrong with that request. Please try again.