diff options
author | Dave Blake <oak99sky@yahoo.co.uk> | 2020-05-16 19:06:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-16 19:06:18 +0100 |
commit | e9847bc01754a989112dcdcc1307981ab387fb3f (patch) | |
tree | 1eb161f3d138c506d21c4af762375785fa4195ec | |
parent | 33760e28b6bb8c6034c1c628ec175d2a56e903fb (diff) | |
parent | 022351c575f56076d3992861c301454680480569 (diff) |
Merge pull request #17852 from smf007/Leia
[Fix][Backport] Fix playback of bus encryption enabled bluray discs
-rw-r--r-- | xbmc/FileItem.cpp | 10 | ||||
-rw-r--r-- | xbmc/FileItem.h | 1 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp | 30 |
3 files changed, 40 insertions, 1 deletions
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp index c576f13e47..928a43a776 100644 --- a/xbmc/FileItem.cpp +++ b/xbmc/FileItem.cpp @@ -1199,6 +1199,16 @@ bool CFileItem::IsBluray() const return item.IsBDFile(); } +bool CFileItem::IsProtectedBlurayDisc() const +{ + std::string path; + path = URIUtils::AddFileToFolder(GetPath(), "AACS", "Unit_Key_RO.inf"); + if (CFile::Exists(path)) + return true; + + return false; +} + bool CFileItem::IsCDDA() const { return URIUtils::IsCDDA(m_strPath); diff --git a/xbmc/FileItem.h b/xbmc/FileItem.h index 63ba0bf698..632855c30b 100644 --- a/xbmc/FileItem.h +++ b/xbmc/FileItem.h @@ -202,6 +202,7 @@ public: bool IsDVDFile(bool bVobs = true, bool bIfos = true) const; bool IsBDFile() const; bool IsBluray() const; + bool IsProtectedBlurayDisc() const; bool IsRAR() const; bool IsAPK() const; bool IsZIP() const; diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp index f01d4d7c09..a431f407bb 100644 --- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp +++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp @@ -139,6 +139,7 @@ bool CDVDInputStreamBluray::Open() std::string root; bool openStream = false; + bool openDisc = false; // The item was selected via the simple menu if (URIUtils::IsProtocol(strPath, "bluray")) @@ -147,6 +148,11 @@ bool CDVDInputStreamBluray::Open() root = url.GetHostName(); filename = URIUtils::GetFileName(url.GetFileName()); + // Check whether disc is AACS protected + CURL url3(root); + CFileItem base(url3, false); + openDisc = base.IsProtectedBlurayDisc(); + // check for a menu call for an image file if (StringUtils::EqualsNoCase(filename, "menu")) { @@ -155,6 +161,11 @@ bool CDVDInputStreamBluray::Open() std::string root2 = url2.GetHostName(); CURL url(root2); CFileItem item(url, false); + + // Check whether disc is AACS protected + if (!openDisc) + openDisc = item.IsProtectedBlurayDisc(); + if (item.IsDiscImage()) { if (!OpenStream(item)) @@ -171,6 +182,10 @@ bool CDVDInputStreamBluray::Open() openStream = true; } + else if (m_item.IsProtectedBlurayDisc()) + { + openDisc = true; + } else { strPath = URIUtils::GetDirectory(strPath); @@ -217,12 +232,25 @@ bool CDVDInputStreamBluray::Open() return false; } } + else if (openDisc) + { + // This special case is required for opening original AACS protected Blu-ray discs. Otherwise + // things like Bus Encryption might not be handled properly and playback will fail. + m_rootPath = root; + if (!bd_open_disc(m_bd, root.c_str(), nullptr)) + { + CLog::Log(LOGERROR, "CDVDInputStreamBluray::Open - failed to open %s in disc mode", + CURL::GetRedacted(root).c_str()); + return false; + } + } else { m_rootPath = root; if (!bd_open_files(m_bd, &m_rootPath, CBlurayCallback::dir_open, CBlurayCallback::file_open)) { - CLog::Log(LOGERROR, "CDVDInputStreamBluray::Open - failed to open %s", CURL::GetRedacted(root).c_str()); + CLog::Log(LOGERROR, "CDVDInputStreamBluray::Open - failed to open %s in files mode", + CURL::GetRedacted(root).c_str()); return false; } } |