Skip to content
This repository
Browse code

[rbp/omxplayer] fixed wrong subtitle offset

  • Loading branch information...
commit 0957f2271d81ab6ab4792cb3122af66871663f35 1 parent 306189c
huceke authored December 28, 2012
4  xbmc/cores/omxplayer/OMXPlayer.cpp
@@ -3708,7 +3708,7 @@ bool COMXPlayer::GetCurrentSubtitle(CStdString& strSubtitle)
3708 3708
   if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD))
3709 3709
     return false;
3710 3710
 
3711  
-  double pts = m_av_clock.OMXMediaTime(false);
  3711
+  double pts = m_av_clock.OMXMediaTime(false, false);
3712 3712
 
3713 3713
   m_player_subtitle.GetCurrentSubtitle(strSubtitle, pts - m_player_video.GetSubtitleDelay());
3714 3714
 
@@ -3869,7 +3869,7 @@ void COMXPlayer::UpdatePlayState(double timeout)
3869 3869
 
3870 3870
     // TODO : workaround until omx clock handling is rewritten
3871 3871
     if(m_playSpeed == DVD_PLAYSPEED_NORMAL)
3872  
-      state.time       = DVD_TIME_TO_MSEC(m_av_clock.OMXMediaTime(true));
  3872
+      state.time       = DVD_TIME_TO_MSEC(m_av_clock.OMXMediaTime(true, true));
3873 3873
     else
3874 3874
       state.time       = DVD_TIME_TO_MSEC(m_av_clock.GetClock() + m_offset_pts);
3875 3875
     state.time_total = m_pDemuxer->GetStreamLength();
4  xbmc/linux/OMXClock.cpp
@@ -711,7 +711,7 @@ double OMXClock::OMXWallTime(bool lock /* = true */)
711 711
   return pts;
712 712
 }
713 713
 
714  
-double OMXClock::OMXMediaTime(bool lock /* = true */)
  714
+double OMXClock::OMXMediaTime(bool fixPreroll /* true */ , bool lock /* = true */)
715 715
 {
716 716
   if(m_omx_clock.GetComponent() == NULL)
717 717
     return 0;
@@ -737,7 +737,7 @@ double OMXClock::OMXMediaTime(bool lock /* = true */)
737 737
 
738 738
   pts = FromOMXTime(timeStamp.nTimestamp);
739 739
 
740  
-  if(pts != 0.0f)
  740
+  if(pts != 0.0f && fixPreroll)
741 741
     pts += (OMX_PRE_ROLL * 1000);
742 742
 
743 743
   if(lock)
2  xbmc/linux/OMXClock.h
@@ -115,7 +115,7 @@ class OMXClock
115 115
   bool OMXStart(bool lock = true);
116 116
   bool OMXReset(bool lock = true);
117 117
   double OMXWallTime(bool lock = true);
118  
-  double OMXMediaTime(bool lock = true);
  118
+  double OMXMediaTime(bool fixPreroll = true, bool lock = true);
119 119
   bool OMXPause(bool lock = true);
120 120
   bool OMXResume(bool lock = true);
121 121
   bool OMXUpdateClock(double pts, bool lock = true);

1 note 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.