Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

paplayer: implement Seek() to support small/bigskipforward/backward

  • Loading branch information...
commit 050826b412c14afe20a88ca5e9905ee4c451677e 1 parent f61f8ba
Sascha Montellese Montellese authored
Showing with 23 additions and 0 deletions.
  1. +23 −0 xbmc/cores/paplayer/PAPlayer.cpp
23 xbmc/cores/paplayer/PAPlayer.cpp
View
@@ -839,6 +839,29 @@ bool PAPlayer::CanSeek()
void PAPlayer::Seek(bool bPlus, bool bLargeStep)
{
+ if (!CanSeek()) return;
+
+ __int64 seek;
+ if (g_advancedSettings.m_musicUseTimeSeeking && GetTotalTime() > 2 * g_advancedSettings.m_musicTimeSeekForwardBig)
+ {
+ if (bLargeStep)
+ seek = bPlus ? g_advancedSettings.m_musicTimeSeekForwardBig : g_advancedSettings.m_musicTimeSeekBackwardBig;
+ else
+ seek = bPlus ? g_advancedSettings.m_musicTimeSeekForward : g_advancedSettings.m_musicTimeSeekBackward;
+ seek *= 1000;
+ seek += GetTime();
+ }
+ else
+ {
+ float percent;
+ if (bLargeStep)
+ percent = bPlus ? (float)g_advancedSettings.m_musicPercentSeekForwardBig : (float)g_advancedSettings.m_musicPercentSeekBackwardBig;
+ else
+ percent = bPlus ? (float)g_advancedSettings.m_musicPercentSeekForward : (float)g_advancedSettings.m_musicPercentSeekBackward;
+ seek = (__int64)(GetTotalTime64() * (GetPercentage() + percent) / 100);
+ }
+
+ SeekTime(seek);
}
void PAPlayer::SeekTime(int64_t iTime /*=0*/)
Please sign in to comment.
Something went wrong with that request. Please try again.