// case 2: all other stacks
else
{
+ LoadVideoSettings(item.GetPath());
+
// see if we have the info in the database
// TODO: If user changes the time speed (FPS via framerate conversion stuff)
// then these times will be wrong.
CVideoDatabase dbs;
if (dbs.Open())
{
- dbs.GetVideoSettings(item.GetPath(), CMediaSettings::Get().GetCurrentVideoSettings());
haveTimes = dbs.GetStackTimes(item.GetPath(), times);
dbs.Close();
}
else
{
options.starttime = item.m_lStartOffset / 75.0;
+ LoadVideoSettings(item.GetPath());
if (item.IsVideo())
{
// open the d/b and retrieve the bookmarks for the current movie
CVideoDatabase dbs;
dbs.Open();
- dbs.GetVideoSettings(item.GetPath(), CMediaSettings::Get().GetCurrentVideoSettings());
if( item.m_lStartOffset == STARTOFFSET_RESUME )
{
// Did the file change?
if (m_progressTrackingItem->GetPath() != "" && m_progressTrackingItem->GetPath() != CurrentFile())
{
- SaveFileState();
+ // Ignore for PVR channels, PerformChannelSwitch takes care of this
+ if (!m_progressTrackingItem->IsPVRChannel())
+ SaveFileState();
// Reset tracking item
m_progressTrackingItem->Reset();
}
}
+void CApplication::LoadVideoSettings(const std::string &path)
+{
+ CVideoDatabase dbs;
+ if (dbs.Open())
+ {
+ CLog::Log(LOGDEBUG, "Loading settings for %s", path.c_str());
+
+ // Load stored settings if they exist, otherwise use default
+ if (!dbs.GetVideoSettings(path, CMediaSettings::Get().GetCurrentVideoSettings()))
+ CMediaSettings::Get().GetCurrentVideoSettings() = CMediaSettings::Get().GetDefaultVideoSettings();
+
+ dbs.Close();
+ }
+}
+
void CApplication::StopPlaying()
{
int iWin = g_windowManager.GetActiveWindow();
PlayBackRet PlayFile(const CFileItem& item, bool bRestart = false);
void SaveFileState(bool bForeground = false);
void UpdateFileState();
+ void LoadVideoSettings(const std::string &path);
void StopPlaying();
void Restart(bool bSamePosition = true);
void DelayedPlayerRestart();