Skip to content

Commit

Permalink
[application] load videosettings by item
Browse files Browse the repository at this point in the history
  • Loading branch information
mkortstiege committed Mar 2, 2015
1 parent b742162 commit 4cea422
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions xbmc/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3042,7 +3042,7 @@ PlayBackRet CApplication::PlayStack(const CFileItem& item, bool bRestart)
// case 2: all other stacks
else
{
LoadVideoSettings(item.GetPath());
LoadVideoSettings(item);

// see if we have the info in the database
// TODO: If user changes the time speed (FPS via framerate conversion stuff)
Expand Down Expand Up @@ -3269,7 +3269,7 @@ PlayBackRet CApplication::PlayFile(const CFileItem& item, bool bRestart)
else
{
options.starttime = item.m_lStartOffset / 75.0;
LoadVideoSettings(item.GetPath());
LoadVideoSettings(item);

if (item.IsVideo())
{
Expand Down Expand Up @@ -3771,15 +3771,15 @@ void CApplication::UpdateFileState()
}
}

void CApplication::LoadVideoSettings(const std::string &path)
void CApplication::LoadVideoSettings(const CFileItem& item)
{
CVideoDatabase dbs;
if (dbs.Open())
{
CLog::Log(LOGDEBUG, "Loading settings for %s", path.c_str());
CLog::Log(LOGDEBUG, "Loading settings for %s", item.GetPath().c_str());

// Load stored settings if they exist, otherwise use default
if (!dbs.GetVideoSettings(path, CMediaSettings::Get().GetCurrentVideoSettings()))
if (!dbs.GetVideoSettings(item, CMediaSettings::Get().GetCurrentVideoSettings()))
CMediaSettings::Get().GetCurrentVideoSettings() = CMediaSettings::Get().GetDefaultVideoSettings();

dbs.Close();
Expand Down
2 changes: 1 addition & 1 deletion xbmc/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs
PlayBackRet PlayFile(const CFileItem& item, bool bRestart = false);
void SaveFileState(bool bForeground = false);
void UpdateFileState();
void LoadVideoSettings(const std::string &path);
void LoadVideoSettings(const CFileItem& item);
void StopPlaying();
void Restart(bool bSamePosition = true);
void DelayedPlayerRestart();
Expand Down
2 changes: 1 addition & 1 deletion xbmc/pvr/PVRManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ bool CPVRManager::PerformChannelSwitch(const CPVRChannelPtr &channel, bool bPrev
// save previous and load new channel's settings (view mode is updated in
// the player)
g_application.SaveFileState();
g_application.LoadVideoSettings(channel->Path());
g_application.LoadVideoSettings(channel);

// set channel as selected item
CGUIWindowPVRBase::SetSelectedItemPath(channel->IsRadio(), channel->Path());
Expand Down

0 comments on commit 4cea422

Please sign in to comment.