diff options
author | Andreas Zelend <ace20022@xbmc.org> | 2018-08-23 18:43:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-23 18:43:08 +0200 |
commit | b5b6c857e84938d434efc18181252121524f2c23 (patch) | |
tree | 6840e11f616b95d2d79e4065da3e9655fec233bb | |
parent | 1c674710b527fe5b41ed55331467efc435aaca93 (diff) | |
parent | db58904c0dbc7e0ec8b8a7967ddc2fdded749dd1 (diff) |
Merge pull request #14343 from ace20022/dvd_resume
[videoplayer] Fix dvd resume
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoPlayer.cpp | 6 | ||||
-rw-r--r-- | xbmc/pvr/recordings/PVRRecording.cpp | 2 | ||||
-rw-r--r-- | xbmc/video/VideoDatabase.cpp | 7 | ||||
-rw-r--r-- | xbmc/video/VideoInfoTag.cpp | 2 | ||||
-rw-r--r-- | xbmc/video/VideoInfoTag.h | 2 |
5 files changed, 11 insertions, 8 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<CDVDInputStream::IMenus> ptr = std::dynamic_pointer_cast<CDVDInputStream::IMenus>(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<CDVDInputStreamNavigator> nav = std::dynamic_pointer_cast<CDVDInputStreamNavigator>(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 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 |