From 1973da4ed3957115dce90edf9c8b63b862a2f3bd Mon Sep 17 00:00:00 2001 From: ace20022 Date: Thu, 23 Aug 2018 16:13:44 +0200 Subject: [vp][db] Fix resuming dvds. The player state was not set for the resume point. --- xbmc/pvr/recordings/PVRRecording.cpp | 2 +- xbmc/video/VideoDatabase.cpp | 7 ++++--- xbmc/video/VideoInfoTag.cpp | 2 +- xbmc/video/VideoInfoTag.h | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/xbmc/pvr/recordings/PVRRecording.cpp b/xbmc/pvr/recordings/PVRRecording.cpp index e011f5063d..7814d8e3a0 100644 --- a/xbmc/pvr/recordings/PVRRecording.cpp +++ b/xbmc/pvr/recordings/PVRRecording.cpp @@ -93,7 +93,7 @@ CPVRRecording::CPVRRecording(const PVR_RECORDING &recording, unsigned int iClien SetGenre(recording.iGenreType, recording.iGenreSubType, recording.strGenreDescription); CVideoInfoTag::SetPlayCount(recording.iPlayCount); - CVideoInfoTag::SetResumePoint(recording.iLastPlayedPosition, recording.iDuration); + CVideoInfoTag::SetResumePoint(recording.iLastPlayedPosition, recording.iDuration, ""); SetDuration(recording.iDuration); // As the channel a recording was done on (probably long time ago) might no longer be diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index de4ad914eb..ae0086dbae 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -2197,7 +2197,8 @@ bool CVideoDatabase::GetFileInfo(const std::string& strFilenameAndPath, CVideoIn if (!details.GetResumePoint().IsSet()) { details.SetResumePoint(m_pDS->fv("bookmark.timeInSeconds").get_asInt(), - m_pDS->fv("bookmark.totalTimeInSeconds").get_asInt()); + m_pDS->fv("bookmark.totalTimeInSeconds").get_asInt(), + m_pDS->fv("bookmark.playerState").get_asString()); } // get streamdetails @@ -3839,7 +3840,7 @@ bool CVideoDatabase::GetResumePoint(CVideoInfoTag& tag) m_pDS2->query( strSQL ); if (!m_pDS2->eof()) { - tag.SetResumePoint(m_pDS2->fv(0).get_asDouble(), m_pDS2->fv(1).get_asDouble()); + tag.SetResumePoint(m_pDS2->fv(0).get_asDouble(), m_pDS2->fv(1).get_asDouble(), ""); match = true; } m_pDS2->close(); @@ -5420,7 +5421,7 @@ bool CVideoDatabase::GetPlayCounts(const std::string &strPath, CFileItemList &it if (!item->GetVideoInfoTag()->GetResumePoint().IsSet()) { - item->GetVideoInfoTag()->SetResumePoint(m_pDS->fv(2).get_asInt(), m_pDS->fv(3).get_asInt()); + item->GetVideoInfoTag()->SetResumePoint(m_pDS->fv(2).get_asInt(), m_pDS->fv(3).get_asInt(), ""); } } m_pDS->next(); diff --git a/xbmc/video/VideoInfoTag.cpp b/xbmc/video/VideoInfoTag.cpp index 3e763154f0..3be5048f3d 100644 --- a/xbmc/video/VideoInfoTag.cpp +++ b/xbmc/video/VideoInfoTag.cpp @@ -1583,7 +1583,7 @@ bool CVideoInfoTag::SetResumePoint(const CBookmark &resumePoint) return true; } -bool CVideoInfoTag::SetResumePoint(double timeInSeconds, double totalTimeInSeconds, const std::string &playerState /* = "" */) +bool CVideoInfoTag::SetResumePoint(double timeInSeconds, double totalTimeInSeconds, const std::string &playerState) { CBookmark resumePoint; resumePoint.timeInSeconds = timeInSeconds; diff --git a/xbmc/video/VideoInfoTag.h b/xbmc/video/VideoInfoTag.h index 2f015d129a..d6b91729ef 100644 --- a/xbmc/video/VideoInfoTag.h +++ b/xbmc/video/VideoInfoTag.h @@ -210,7 +210,7 @@ public: * @param playerState the player state * @return True if resume point was set successfully, false otherwise. */ - virtual bool SetResumePoint(double timeInSeconds, double totalTimeInSeconds, const std::string &playerState = ""); + virtual bool SetResumePoint(double timeInSeconds, double totalTimeInSeconds, const std::string &playerState); std::string m_basePath; // the base path of the video, for folder-based lookups int m_parentPathID; // the parent path id where the base path of the video lies -- cgit v1.2.3 From db58904c0dbc7e0ec8b8a7967ddc2fdded749dd1 Mon Sep 17 00:00:00 2001 From: ace20022 Date: Thu, 23 Aug 2018 16:15:06 +0200 Subject: [videoplayer] Don't try to open default streams while opening a resumed dvd. --- xbmc/cores/VideoPlayer/VideoPlayer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp index 1b1db2cf00..1cb0e6574c 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp @@ -1260,6 +1260,7 @@ void CVideoPlayer::Prepare() return; } + bool discStateRestored = false; if (std::shared_ptr ptr = std::dynamic_pointer_cast(m_pInputStream)) { CLog::Log(LOGNOTICE, "VideoPlayer: playing a file with menu's"); @@ -1267,7 +1268,7 @@ void CVideoPlayer::Prepare() m_playerOptions.starttime = 0; if (!m_playerOptions.state.empty()) - ptr->SetState(m_playerOptions.state); + discStateRestored = ptr->SetState(m_playerOptions.state); else if(std::shared_ptr nav = std::dynamic_pointer_cast(m_pInputStream)) nav->EnableSubtitleStream(m_processInfo->GetVideoSettings().m_SubtitleOn); } @@ -1293,7 +1294,8 @@ void CVideoPlayer::Prepare() m_OmxPlayerState.av_clock.OMXPause(); } - OpenDefaultStreams(); + if (!discStateRestored) + OpenDefaultStreams(); /* * Check to see if the demuxer should start at something other than time 0. This will be the case -- cgit v1.2.3