aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in3
-rw-r--r--addons/skin.confluence/fonts/LICENCE.txt (renamed from addons/skin.confluence/fonts/NOTICE.txt)33
-rw-r--r--addons/skin.confluence/fonts/README.txt31
-rw-r--r--addons/skin.confluence/fonts/Roboto-Bold.ttfbin163448 -> 162464 bytes
-rw-r--r--addons/skin.confluence/fonts/Roboto-Regular.ttfbin158604 -> 162876 bytes
-rw-r--r--media/Splash.pngbin70021 -> 69954 bytes
-rw-r--r--project/cmake/addons/addons/pvr.stalker/platforms.txt1
-rw-r--r--project/cmake/addons/addons/pvr.stalker/pvr.stalker.txt1
-rw-r--r--tools/android/packaging/xbmc/AndroidManifest.xml.in1
-rw-r--r--xbmc/ApplicationPlayer.cpp14
-rw-r--r--xbmc/ApplicationPlayer.h1
-rw-r--r--xbmc/GUIInfoManager.cpp38
-rw-r--r--xbmc/GUIInfoManager.h6
-rw-r--r--xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp4
-rw-r--r--xbmc/cores/DllLoader/exports/emu_msvcrt.cpp3
-rw-r--r--xbmc/cores/IPlayer.h6
-rw-r--r--xbmc/cores/dvdplayer/DVDPlayer.cpp9
-rw-r--r--xbmc/cores/dvdplayer/DVDPlayer.h1
-rw-r--r--xbmc/dialogs/GUIDialogSeekBar.cpp5
-rw-r--r--xbmc/pictures/SlideShowPicture.cpp14
-rw-r--r--xbmc/pvr/channels/PVRChannelGroups.cpp5
-rw-r--r--xbmc/utils/SeekHandler.cpp143
-rw-r--r--xbmc/utils/SeekHandler.h7
-rw-r--r--xbmc/utils/win32/Win32InterfaceForCLog.cpp2
24 files changed, 186 insertions, 142 deletions
diff --git a/Makefile.in b/Makefile.in
index 1374ce80f5..7ed7c37f34 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -623,6 +623,9 @@ endif
@for f in project/cmake/scripts/common/*.cmake; do \
install -m 0644 $$f $(DESTDIR)$(libdir)/@APP_NAME_LC@; \
done
+ifeq ($(findstring linux,@host@),linux)
+ install -m 0644 project/cmake/scripts/linux/UseMultiArch.cmake $(DESTDIR)$(libdir)/@APP_NAME_LC@
+endif
@cd $(DESTDIR)$(includedir); [ -L xbmc ] || [ -d xbmc ] || ln -s @APP_NAME_LC@ xbmc
uninstall:
diff --git a/addons/skin.confluence/fonts/NOTICE.txt b/addons/skin.confluence/fonts/LICENCE.txt
index c5b1efa7aa..277e097abd 100644
--- a/addons/skin.confluence/fonts/NOTICE.txt
+++ b/addons/skin.confluence/fonts/LICENCE.txt
@@ -1,15 +1,19 @@
- Copyright (c) 2005-2008, The Android Open Source Project
+ Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-
+
+ -------------------------------------------------------------------------
Apache License
Version 2.0, January 2004
@@ -188,3 +192,28 @@
END OF TERMS AND CONDITIONS
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/addons/skin.confluence/fonts/README.txt b/addons/skin.confluence/fonts/README.txt
index 1a96dfde6c..96c262ad57 100644
--- a/addons/skin.confluence/fonts/README.txt
+++ b/addons/skin.confluence/fonts/README.txt
@@ -1,18 +1,19 @@
-Copyright (C) 2008 The Android Open Source Project
+ Copyright 2011 Google Inc. All Rights Reserved.
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
-##########
+ http://www.apache.org/licenses/LICENSE-2.0
-This directory contains the fonts for the platform. They are licensed
-under the Apache 2 license.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+------------------------------------------------------------------------
+
+This directory contains the fonts for the platform.
+
+Source: https://github.com/google/fonts/tree/master/apache/roboto
diff --git a/addons/skin.confluence/fonts/Roboto-Bold.ttf b/addons/skin.confluence/fonts/Roboto-Bold.ttf
index 91ec212278..a355c27cde 100644
--- a/addons/skin.confluence/fonts/Roboto-Bold.ttf
+++ b/addons/skin.confluence/fonts/Roboto-Bold.ttf
Binary files differ
diff --git a/addons/skin.confluence/fonts/Roboto-Regular.ttf b/addons/skin.confluence/fonts/Roboto-Regular.ttf
index 7d9a6c4c32..8c082c8de0 100644
--- a/addons/skin.confluence/fonts/Roboto-Regular.ttf
+++ b/addons/skin.confluence/fonts/Roboto-Regular.ttf
Binary files differ
diff --git a/media/Splash.png b/media/Splash.png
index b3c6821251..7513985b37 100644
--- a/media/Splash.png
+++ b/media/Splash.png
Binary files differ
diff --git a/project/cmake/addons/addons/pvr.stalker/platforms.txt b/project/cmake/addons/addons/pvr.stalker/platforms.txt
new file mode 100644
index 0000000000..0702cb5bfb
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.stalker/platforms.txt
@@ -0,0 +1 @@
+all
diff --git a/project/cmake/addons/addons/pvr.stalker/pvr.stalker.txt b/project/cmake/addons/addons/pvr.stalker/pvr.stalker.txt
new file mode 100644
index 0000000000..b74b305a5a
--- /dev/null
+++ b/project/cmake/addons/addons/pvr.stalker/pvr.stalker.txt
@@ -0,0 +1 @@
+pvr.stalker https://github.com/kodi-pvr/pvr.stalker 118b2ef
diff --git a/tools/android/packaging/xbmc/AndroidManifest.xml.in b/tools/android/packaging/xbmc/AndroidManifest.xml.in
index 8e94e3a0c8..8b56713dc5 100644
--- a/tools/android/packaging/xbmc/AndroidManifest.xml.in
+++ b/tools/android/packaging/xbmc/AndroidManifest.xml.in
@@ -5,7 +5,6 @@
android:versionCode="@APP_VERSION_CODE@"
android:versionName="@APP_VERSION@" >
- <!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
diff --git a/xbmc/ApplicationPlayer.cpp b/xbmc/ApplicationPlayer.cpp
index 64e323ee4b..75ae4d1a1a 100644
--- a/xbmc/ApplicationPlayer.cpp
+++ b/xbmc/ApplicationPlayer.cpp
@@ -264,6 +264,20 @@ void CApplicationPlayer::SeekTime(int64_t iTime)
player->SeekTime(iTime);
}
+void CApplicationPlayer::SeekTimeRelative(int64_t iTime)
+{
+ std::shared_ptr<IPlayer> player = GetInternal();
+ if (player)
+ {
+ // use relative seeking if implemented by player
+ if (!player->SeekTimeRelative(iTime))
+ {
+ int64_t abstime = player->GetTime() + iTime;
+ player->SeekTime(abstime);
+ }
+ }
+}
+
std::string CApplicationPlayer::GetPlayingTitle()
{
std::shared_ptr<IPlayer> player = GetInternal();
diff --git a/xbmc/ApplicationPlayer.h b/xbmc/ApplicationPlayer.h
index 7688264e25..e18c8a1a0f 100644
--- a/xbmc/ApplicationPlayer.h
+++ b/xbmc/ApplicationPlayer.h
@@ -140,6 +140,7 @@ public:
void SeekPercentage(float fPercent = 0);
bool SeekScene(bool bPlus = true);
void SeekTime(int64_t iTime = 0);
+ void SeekTimeRelative(int64_t iTime = 0);
void SetAudioStream(int iStream);
void SetAVDelay(float fValue = 0.0f);
void SetDynamicRangeCompression(long drc);
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index 7dbe1fe522..1e5ef92410 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -112,8 +112,6 @@ CGUIInfoManager::CGUIInfoManager(void) :
m_fanSpeed = 0;
m_AfterSeekTimeout = 0;
m_seekOffset = 0;
- m_playerSeeking = false;
- m_performingSeek = false;
m_nextWindowID = WINDOW_INVALID;
m_prevWindowID = WINDOW_INVALID;
m_stringParameters.push_back("__ZZZZ__"); // to offset the string parameters by 1 to assure that all entries are non-zero
@@ -2144,7 +2142,7 @@ bool CGUIInfoManager::GetInt(int &value, int info, int contextWindow, const CGUI
value = (int)(g_application.GetCachePercentage());
break;
case PLAYER_SEEKBAR:
- value = (int)CSeekHandler::Get().GetPercent();
+ value = (int)GetSeekPercent();
break;
case PLAYER_CACHELEVEL:
value = (int)(g_application.m_pPlayer->GetCacheLevel());
@@ -2592,7 +2590,7 @@ bool CGUIInfoManager::GetBool(int condition1, int contextWindow, const CGUIListI
}
break;
case PLAYER_SEEKING:
- bReturn = m_playerSeeking;
+ bReturn = CSeekHandler::Get().InProgress();
break;
case PLAYER_SHOWTIME:
bReturn = m_playerShowTime;
@@ -3276,11 +3274,12 @@ std::string CGUIInfoManager::GetMultiInfoLabel(const GUIInfo &info, int contextW
}
else if (info.m_info == PLAYER_SEEKSTEPSIZE)
{
- std::string seekOffset = StringUtils::SecondsToTimeString(abs(m_seekStepSize), (TIME_FORMAT)info.GetData1());
- if (m_seekStepSize < 0)
- return "-" + seekOffset;
- if (m_seekStepSize > 0)
- return "+" + seekOffset;
+ int seekSize = CSeekHandler::Get().GetSeekSize();
+ std::string strSeekSize = StringUtils::SecondsToTimeString(abs(seekSize), (TIME_FORMAT)info.GetData1());
+ if (seekSize < 0)
+ return "-" + strSeekSize;
+ if (seekSize > 0)
+ return "+" + strSeekSize;
}
else if (info.m_info == PLAYER_ITEM_ART)
{
@@ -4110,8 +4109,7 @@ std::string CGUIInfoManager::GetCurrentSeekTime(TIME_FORMAT format) const
{
if (format == TIME_FORMAT_GUESS && GetTotalPlayTime() >= 3600)
format = TIME_FORMAT_HH_MM_SS;
- float time = GetTotalPlayTime() * CSeekHandler::Get().GetPercent() * 0.01f;
- return StringUtils::SecondsToTimeString((int)time, format);
+ return StringUtils::SecondsToTimeString(g_application.GetTime() + CSeekHandler::Get().GetSeekSize(), format);
}
int CGUIInfoManager::GetTotalPlayTime() const
@@ -4126,6 +4124,23 @@ int CGUIInfoManager::GetPlayTimeRemaining() const
return iReverse > 0 ? iReverse : 0;
}
+float CGUIInfoManager::GetSeekPercent() const
+{
+ if (g_infoManager.GetTotalPlayTime() == 0)
+ return 0.0f;
+
+ float percentPlayTime = static_cast<float>(GetPlayTime()) / GetTotalPlayTime() * 0.1f;
+ float percentPerSecond = 100.0f / static_cast<float>(GetTotalPlayTime());
+ float percent = percentPlayTime + percentPerSecond * CSeekHandler::Get().GetSeekSize();
+
+ if (percent > 100.0f)
+ percent = 100.0f;
+ if (percent < 0.0f)
+ percent = 0.0f;
+
+ return percent;
+}
+
std::string CGUIInfoManager::GetCurrentPlayTimeRemaining(TIME_FORMAT format) const
{
if (format == TIME_FORMAT_GUESS && GetTotalPlayTime() >= 3600)
@@ -4359,7 +4374,6 @@ std::string CGUIInfoManager::GetAppName()
void CGUIInfoManager::SetDisplayAfterSeek(unsigned int timeOut, int seekOffset)
{
- g_infoManager.m_performingSeek = false;
if (timeOut>0)
{
m_AfterSeekTimeout = CTimeUtils::GetFrameTime() + timeOut;
diff --git a/xbmc/GUIInfoManager.h b/xbmc/GUIInfoManager.h
index 6bc66ac2ef..2ff5fff844 100644
--- a/xbmc/GUIInfoManager.h
+++ b/xbmc/GUIInfoManager.h
@@ -803,6 +803,7 @@ public:
std::string GetCurrentSeekTime(TIME_FORMAT format = TIME_FORMAT_GUESS) const;
int GetPlayTimeRemaining() const;
int GetTotalPlayTime() const;
+ float GetSeekPercent() const;
std::string GetCurrentPlayTimeRemaining(TIME_FORMAT format) const;
std::string GetVersionShort(void);
std::string GetAppName();
@@ -811,14 +812,11 @@ public:
bool GetDisplayAfterSeek();
void SetDisplayAfterSeek(unsigned int timeOut = 2500, int seekOffset = 0);
- void SetSeekStepSize(int seekStepSize) { m_seekStepSize = seekStepSize; };
- void SetSeeking(bool seeking) { m_playerSeeking = seeking; };
void SetShowTime(bool showtime) { m_playerShowTime = showtime; };
void SetShowCodec(bool showcodec) { m_playerShowCodec = showcodec; };
void SetShowInfo(bool showinfo) { m_playerShowInfo = showinfo; };
void ToggleShowCodec() { m_playerShowCodec = !m_playerShowCodec; };
bool ToggleShowInfo() { m_playerShowInfo = !m_playerShowInfo; return m_playerShowInfo; };
- bool m_performingSeek;
std::string GetSystemHeatInfo(int info);
CTemperature GetGPUTemperature();
@@ -939,8 +937,6 @@ protected:
//Fullscreen OSD Stuff
unsigned int m_AfterSeekTimeout;
int m_seekOffset;
- int m_seekStepSize;
- bool m_playerSeeking;
bool m_playerShowTime;
bool m_playerShowCodec;
bool m_playerShowInfo;
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
index bf7e439321..ec64363d91 100644
--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
@@ -30,8 +30,8 @@ using namespace ActiveAE;
#include "settings/Settings.h"
#include "windowing/WindowingFactory.h"
-#define MAX_CACHE_LEVEL 0.5 // total cache time of stream in seconds
-#define MAX_WATER_LEVEL 0.25 // buffered time after stream stages in seconds
+#define MAX_CACHE_LEVEL 0.4 // total cache time of stream in seconds
+#define MAX_WATER_LEVEL 0.2 // buffered time after stream stages in seconds
#define MAX_BUFFER_TIME 0.1 // max time of a buffer in seconds
void CEngineStats::Reset(unsigned int sampleRate)
diff --git a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
index f3f70e450e..7f0b74ed82 100644
--- a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
+++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
@@ -1313,7 +1313,8 @@ extern "C"
{
if (g_emuFileWrapper.StreamIsEmulatedFile(stream))
{
- not_implement("msvcrt.dll fake function dll_fputs() called\n");
+ size_t len = strlen(szLine);
+ return dll_fwrite(static_cast<const void*>(szLine), sizeof(char), len, stream);
}
else if (!IS_STD_STREAM(stream))
{
diff --git a/xbmc/cores/IPlayer.h b/xbmc/cores/IPlayer.h
index 6c08bcee07..37aefee462 100644
--- a/xbmc/cores/IPlayer.h
+++ b/xbmc/cores/IPlayer.h
@@ -194,6 +194,12 @@ public:
virtual float GetActualFPS() { return 0.0f; };
virtual void SeekTime(int64_t iTime = 0){};
+ /*
+ \brief seek relative to current time, returns false if not implemented by player
+ \param iTime The time in milliseconds to seek. A positive value will seek forward, a negative backward.
+ \return True if the player supports relative seeking, otherwise false
+ */
+ virtual bool SeekTimeRelative(int64_t iTime) { return false; }
/*!
\brief current time in milliseconds
*/
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp
index 37865b5d18..3895456ab1 100644
--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp
+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -3163,6 +3163,15 @@ void CDVDPlayer::SeekTime(int64_t iTime)
m_callback.OnPlayBackSeek((int)iTime, seekOffset);
}
+bool CDVDPlayer::SeekTimeRelative(int64_t iTime)
+{
+ int64_t abstime = GetTime() + iTime;
+ m_messenger.Put(new CDVDMsgPlayerSeek((int)abstime, (iTime < 0) ? true : false, true, false));
+ SynchronizeDemuxer(100);
+ m_callback.OnPlayBackSeek((int)abstime, iTime);
+ return true;
+}
+
// return the time in milliseconds
int64_t CDVDPlayer::GetTime()
{
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h
index f9e4bf76f8..e0207f210a 100644
--- a/xbmc/cores/dvdplayer/DVDPlayer.h
+++ b/xbmc/cores/dvdplayer/DVDPlayer.h
@@ -267,6 +267,7 @@ public:
virtual int SeekChapter(int iChapter);
virtual void SeekTime(int64_t iTime);
+ virtual bool SeekTimeRelative(int64_t iTime);
virtual int64_t GetTime();
virtual int64_t GetTotalTime();
virtual void ToFFRW(int iSpeed);
diff --git a/xbmc/dialogs/GUIDialogSeekBar.cpp b/xbmc/dialogs/GUIDialogSeekBar.cpp
index 686dd3e90b..d8b01cc63d 100644
--- a/xbmc/dialogs/GUIDialogSeekBar.cpp
+++ b/xbmc/dialogs/GUIDialogSeekBar.cpp
@@ -68,15 +68,14 @@ void CGUIDialogSeekBar::FrameMove()
}
// update controls
- if (!CSeekHandler::Get().InProgress() && !g_infoManager.m_performingSeek
- && g_infoManager.GetTotalPlayTime())
+ if (!CSeekHandler::Get().InProgress() && g_infoManager.GetTotalPlayTime())
{ // position the bar at our current time
CONTROL_SELECT_ITEM(POPUP_SEEK_PROGRESS, (unsigned int)(g_infoManager.GetPlayTime()/g_infoManager.GetTotalPlayTime() * 0.1f));
SET_CONTROL_LABEL(POPUP_SEEK_LABEL, g_infoManager.GetCurrentPlayTime());
}
else
{
- CONTROL_SELECT_ITEM(POPUP_SEEK_PROGRESS, (unsigned int)CSeekHandler::Get().GetPercent());
+ CONTROL_SELECT_ITEM(POPUP_SEEK_PROGRESS, (unsigned int)g_infoManager.GetSeekPercent());
SET_CONTROL_LABEL(POPUP_SEEK_LABEL, g_infoManager.GetCurrentSeekTime());
}
diff --git a/xbmc/pictures/SlideShowPicture.cpp b/xbmc/pictures/SlideShowPicture.cpp
index f9930f71d8..28a74d6edc 100644
--- a/xbmc/pictures/SlideShowPicture.cpp
+++ b/xbmc/pictures/SlideShowPicture.cpp
@@ -764,10 +764,16 @@ void CSlideShowPic::Render(float *x, float *y, CBaseTexture* pTexture, color_t c
vertex[i].col = color;
}
- vertex[1].tu = 1.0f;
- vertex[2].tu = 1.0f;
- vertex[2].tv = 1.0f;
- vertex[3].tv = 1.0f;
+ if (pTexture)
+ {
+ vertex[1].tu = vertex[2].tu = (float)pTexture->GetWidth() / pTexture->GetTextureWidth();
+ vertex[2].tv = vertex[3].tv = (float)pTexture->GetHeight() / pTexture->GetTextureHeight();
+ }
+ else
+ {
+ vertex[1].tu = vertex[2].tu = 1.0f;
+ vertex[2].tv = vertex[3].tv = 1.0f;
+ }
vertex[4] = vertex[0]; // Not used when pTexture != NULL
diff --git a/xbmc/pvr/channels/PVRChannelGroups.cpp b/xbmc/pvr/channels/PVRChannelGroups.cpp
index a6e772346d..b7e6f8f401 100644
--- a/xbmc/pvr/channels/PVRChannelGroups.cpp
+++ b/xbmc/pvr/channels/PVRChannelGroups.cpp
@@ -77,8 +77,9 @@ bool CPVRChannelGroups::Update(const CPVRChannelGroup &group, bool bUpdateFromCl
if (!updateGroup)
{
- // create a new group if none was found
- updateGroup = CPVRChannelGroupPtr(new CPVRChannelGroup());
+ // create a new group if none was found. Copy the properties immediately
+ // so the group doesn't get flagged as "changed" further down.
+ updateGroup = CPVRChannelGroupPtr(new CPVRChannelGroup(group.IsRadio(), group.GroupID(), group.GroupName()));
m_groups.push_back(updateGroup);
}
diff --git a/xbmc/utils/SeekHandler.cpp b/xbmc/utils/SeekHandler.cpp
index dbc4d933c6..53bd461207 100644
--- a/xbmc/utils/SeekHandler.cpp
+++ b/xbmc/utils/SeekHandler.cpp
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include "guilib/LocalizeStrings.h"
-#include "GUIInfoManager.h"
+#include "guilib/GraphicContext.h"
#include "Application.h"
#include "FileItem.h"
#include "settings/AdvancedSettings.h"
@@ -34,9 +34,8 @@
CSeekHandler::CSeekHandler()
: m_seekDelay(500),
m_requireSeek(false),
- m_percent(0.0f),
- m_percentPlayTime(0.0f),
m_analogSeek(false),
+ m_seekSize(0),
m_seekStep(0)
{
}
@@ -57,8 +56,8 @@ CSeekHandler& CSeekHandler::Get()
void CSeekHandler::Reset()
{
m_requireSeek = false;
- m_percent = 0;
m_seekStep = 0;
+ m_seekSize = 0;
m_seekDelays.clear();
m_seekDelays.insert(std::make_pair(SEEK_TYPE_VIDEO, CSettings::Get().GetInt("videoplayer.seekdelay")));
@@ -91,95 +90,82 @@ void CSeekHandler::Reset()
}
}
-int CSeekHandler::GetSeekSeconds(bool forward, SeekType type)
+int CSeekHandler::GetSeekStepSize(SeekType type, int step)
{
- m_seekStep = m_seekStep + (forward ? 1 : -1);
-
- if (m_seekStep == 0)
- return 0;
-
- std::vector<int> seekSteps(m_seekStep > 0 ? m_forwardSeekSteps.at(type) : m_backwardSeekSteps.at(type));
+ std::vector<int> seekSteps(step > 0 ? m_forwardSeekSteps.at(type) : m_backwardSeekSteps.at(type));
if (seekSteps.empty())
{
CLog::Log(LOGERROR, "SeekHandler - %s - No %s %s seek steps configured.", __FUNCTION__,
- (type == SeekType::SEEK_TYPE_VIDEO ? "video" : "music"), (m_seekStep > 0 ? "forward" : "backward"));
+ (type == SeekType::SEEK_TYPE_VIDEO ? "video" : "music"), (step > 0 ? "forward" : "backward"));
return 0;
}
int seconds = 0;
// when exceeding the selected amount of steps repeat/sum up the last step size
- if (static_cast<size_t>(abs(m_seekStep)) <= seekSteps.size())
- seconds = seekSteps.at(abs(m_seekStep) - 1);
+ if (static_cast<size_t>(abs(step)) <= seekSteps.size())
+ seconds = seekSteps.at(abs(step) - 1);
else
- seconds = seekSteps.back() * (abs(m_seekStep) - seekSteps.size() + 1);
+ seconds = seekSteps.back() * (abs(step) - seekSteps.size() + 1);
return seconds;
}
void CSeekHandler::Seek(bool forward, float amount, float duration /* = 0 */, bool analogSeek /* = false */, SeekType type /* = SEEK_TYPE_VIDEO */)
{
- // abort if we do not have a play time or already perform a seek
- if (g_infoManager.GetTotalPlayTime() == 0 ||
- g_infoManager.m_performingSeek)
- return;
-
CSingleLock lock(m_critSection);
// not yet seeking
if (!m_requireSeek)
{
- m_percent = static_cast<float>(g_infoManager.GetPlayTime()) / g_infoManager.GetTotalPlayTime() * 0.1f;
- m_percentPlayTime = m_percent;
+ // use only the first step forward/backward for a seek without a delay
+ if (!analogSeek && m_seekDelays.at(type) == 0)
+ {
+ SeekSeconds(GetSeekStepSize(type, forward ? 1 : -1));
+ return;
+ }
- // tell info manager that we have started a seek operation
m_requireSeek = true;
- g_infoManager.SetSeeking(true);
m_seekStep = 0;
+ m_seekSize = 0;
m_analogSeek = analogSeek;
m_seekDelay = analogSeek ? analogSeekDelay : m_seekDelays.at(type);
}
// calculate our seek amount
- if (!g_infoManager.m_performingSeek)
+ if (analogSeek)
{
- if (analogSeek)
- {
- //100% over 1 second.
- float speed = 100.0f;
- if( duration )
- speed *= duration;
- else
- speed /= g_infoManager.GetFPS();
+ //100% over 1 second.
+ float speed = 100.0f;
+ if( duration )
+ speed *= duration;
+ else
+ speed /= g_graphicsContext.GetFPS();
- if (forward)
- m_percent += amount * amount * speed;
- else
- m_percent -= amount * amount * speed;
+ double totalTime = g_application.GetTotalTime();
+ if (totalTime < 0)
+ totalTime = 0;
+
+ int seekSize = (amount * amount * speed) * totalTime / 100;
+ if (forward)
+ m_seekSize += seekSize;
+ else
+ m_seekSize -= seekSize;
+ }
+ else
+ {
+ m_seekStep += forward ? 1 : -1;
+ int seekSeconds = GetSeekStepSize(type, m_seekStep);
+ if (seekSeconds != 0)
+ {
+ m_seekSize = seekSeconds;
}
else
{
- int seekSeconds = GetSeekSeconds(forward, type);
- if (seekSeconds != 0)
- {
- float percentPerSecond = 100.0f / static_cast<float>(g_infoManager.GetTotalPlayTime());
- m_percent = m_percentPlayTime + percentPerSecond * seekSeconds;
-
- g_infoManager.SetSeekStepSize(seekSeconds);
- }
- else
- {
- // nothing to do, abort seeking
- m_requireSeek = false;
- g_infoManager.SetSeeking(false);
- }
+ // nothing to do, abort seeking
+ m_requireSeek = false;
}
-
- if (m_percent > 100.0f)
- m_percent = 100.0f;
- if (m_percent < 0.0f)
- m_percent = 0.0f;
}
m_timer.StartZero();
@@ -188,35 +174,19 @@ void CSeekHandler::Seek(bool forward, float amount, float duration /* = 0 */, bo
void CSeekHandler::SeekSeconds(int seconds)
{
// abort if we do not have a play time or already perform a seek
- if (seconds == 0 ||
- g_infoManager.GetTotalPlayTime() == 0 ||
- g_infoManager.m_performingSeek)
+ if (seconds == 0)
return;
CSingleLock lock(m_critSection);
+ m_seekSize = seconds;
- m_requireSeek = true;
- m_seekDelay = 0;
-
- g_infoManager.SetSeeking(true);
- g_infoManager.SetSeekStepSize(seconds);
-
- float percentPlayTime = static_cast<float>(g_infoManager.GetPlayTime()) / g_infoManager.GetTotalPlayTime() * 0.1f;
- float percentPerSecond = 100.0f / static_cast<float>(g_infoManager.GetTotalPlayTime());
-
- m_percent = percentPlayTime + percentPerSecond * seconds;
-
- if (m_percent > 100.0f)
- m_percent = 100.0f;
- if (m_percent < 0.0f)
- m_percent = 0.0f;
-
- m_timer.StartZero();
+ // perform relative seek
+ g_application.m_pPlayer->SeekTimeRelative(static_cast<int64_t>(seconds * 1000));
}
-float CSeekHandler::GetPercent() const
+int CSeekHandler::GetSeekSize() const
{
- return m_percent;
+ return m_seekSize;
}
bool CSeekHandler::InProgress() const
@@ -228,17 +198,12 @@ void CSeekHandler::Process()
{
if (m_timer.GetElapsedMilliseconds() >= m_seekDelay && m_requireSeek)
{
- g_infoManager.m_performingSeek = true;
-
- // reset seek step size
- g_infoManager.SetSeekStepSize(0);
+ CSingleLock lock(m_critSection);
- // calculate the seek time
- double time = g_infoManager.GetTotalPlayTime() * m_percent * 0.01;
+ // perform relative seek
+ g_application.m_pPlayer->SeekTimeRelative(static_cast<int64_t>(m_seekSize * 1000));
- g_application.SeekTime(time);
m_requireSeek = false;
- g_infoManager.SetSeeking(false);
}
}
@@ -303,14 +268,12 @@ bool CSeekHandler::OnAction(const CAction &action)
}
case ACTION_NEXT_SCENE:
{
- if (g_application.m_pPlayer->SeekScene(true))
- g_infoManager.SetDisplayAfterSeek();
+ g_application.m_pPlayer->SeekScene(true);
return true;
}
case ACTION_PREV_SCENE:
{
- if (g_application.m_pPlayer->SeekScene(false))
- g_infoManager.SetDisplayAfterSeek();
+ g_application.m_pPlayer->SeekScene(false);
return true;
}
case ACTION_ANALOG_SEEK_FORWARD:
diff --git a/xbmc/utils/SeekHandler.h b/xbmc/utils/SeekHandler.h
index 7782bb05fd..097a8db630 100644
--- a/xbmc/utils/SeekHandler.h
+++ b/xbmc/utils/SeekHandler.h
@@ -48,7 +48,7 @@ public:
void Process();
void Reset();
- float GetPercent() const;
+ int GetSeekSize() const;
bool InProgress() const;
protected:
@@ -60,13 +60,12 @@ protected:
private:
static const int analogSeekDelay = 500;
- int GetSeekSeconds(bool forward, SeekType type);
+ int GetSeekStepSize(SeekType type, int step);
int m_seekDelay;
std::map<SeekType, int > m_seekDelays;
bool m_requireSeek;
- float m_percent;
- float m_percentPlayTime;
bool m_analogSeek;
+ int m_seekSize;
int m_seekStep;
std::map<SeekType, std::vector<int> > m_forwardSeekSteps;
std::map<SeekType, std::vector<int> > m_backwardSeekSteps;
diff --git a/xbmc/utils/win32/Win32InterfaceForCLog.cpp b/xbmc/utils/win32/Win32InterfaceForCLog.cpp
index 6daf40f9ed..95996699cd 100644
--- a/xbmc/utils/win32/Win32InterfaceForCLog.cpp
+++ b/xbmc/utils/win32/Win32InterfaceForCLog.cpp
@@ -67,6 +67,7 @@ bool CWin32InterfaceForCLog::OpenLogFile(const std::string& logFilename, const s
static const unsigned char BOM[3] = { 0xEF, 0xBB, 0xBF };
DWORD written;
(void)WriteFile(m_hFile, BOM, sizeof(BOM), &written, NULL); // write BOM, ignore possible errors
+ (void)FlushFileBuffers(m_hFile);
return true;
}
@@ -91,7 +92,6 @@ bool CWin32InterfaceForCLog::WriteStringToLog(const std::string& logString)
DWORD written;
const bool ret = (WriteFile(m_hFile, strData.c_str(), strData.length(), &written, NULL) != 0) && written == strData.length();
- (void)FlushFileBuffers(m_hFile);
return ret;
}