Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bluray directory support #872

Merged
merged 3 commits into from

3 participants

@elupus
Collaborator

This adds a bluray virtual directory to more easily navigate a bluray file with it's title tracks and playlists.

Something similar aught to be done for dvd's too. This gives a directory structure like:

/titles/Title 1 [duration]
/titles/Title 2 [duration]
/titles/Title 3 [duration]
/Menus
/Title 5 [duration] ///< this is the longest duration title

It also contains a commit which during scanning avoids all title's apart from the longest titles in the root (can be multiple, set to larger than 2/3 of the longest title).

@da-anda
Collaborator

haven't tested it yet, and although I really welcome a way to select the BD stream, I don't think this should be done as VFS structure, because it's none and IMO needs different treatment/presentation. We should think of alternatives here for a better user experience - something like a popup/dialog and/or a overlay menu during playback.

@elupus
Collaborator

Yea.. i sort of agree. Doesn't really hinder it being added as a virtual file system. For example, when we start playback on an item, we do a getdirectory request on it, if that returns elements we pop up a dialog with the result of that.

@jmarshallnz , @cptspiff thought?

@ghost

as you say one does not exclude the other and having it available as vfs makes sense no matter.

@elupus
Collaborator

Well, combining it with the resume file dialog would make a lot of sence.. Seeing as that would pop up after otherwise.

@elupus
Collaborator

Ok, so comments but the define addressed. Looks much nicer now with the GuiDialogSelect instead.

The scanning hints change can now be skipped, since nothing is really using it. Not sure it was a good idea anyway.

@JezzX this is going to need some skinning work too. Seems GuiDialogSelect is very geared to addons it seem. The fileitems added to it have filesize and runtime. I'm not sure what else i might be able to extract about them yet.

@JezzX
Collaborator

Sorry as a none coder I'm a little confused as too what this does.
does this do that when you click on a bluray directory it pops up dialog select with a list of Menued items on the blueray in plain english names that the disc gives it ?

If so I would just go for using the non addon id 3 list instead of id 6 and then I can add a label 2 too it so Label1 = title Label2 = duration any extra info is just fluff end users don't really care about the file size when trying to play something.

@elupus
Collaborator

Sadly there are no english names. So it will just list:
Main Title 1
Main Title 2
Menus
All Titles (subfolder)

Then in All Titles:
All Titles/Title 1
All Titles/Title ...
All Titles/Title XX

But they do have possible metadata like duration and file size and possibly even video codec/audio codec and stuff like that.

@elupus
Collaborator

So this is a alternate solution for this. (note the content type commits you can technically ignore, suppose they can be dropped). It will pop up a dialog for selection when a movie is tarted.

I'm far from happy with this thou as there is no good way to find all paths that we can start playback. With this, play from favorites, won't show dialog for example.

Don't like the idea of duplicating code for that. Any ideas on how to handle this @cptspiff , @jmarshallnz ?

@ghost

seems it's already somewhat based on duplication for resume in playmedia builtin. best you can do is break it out in a separate function as is done for ShowResumeMenu..

@elupus
Collaborator

Ok. I think this is pretty much ready to go as a step in the right direction at least.

@elupus elupus merged commit 22e9485 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
5 language/English/strings.xml
@@ -2253,6 +2253,11 @@
<string id="24101">Would you like to download this Add-on?</string>
<string id="25000">Notifications</string>
<string id="25001">Hide foreign</string>
+ <string id="25002">Select from all titles ...</string>
+ <string id="25003">Show bluray menus</string>
+ <string id="25004">Play main title: %d</string>
+ <string id="25005">Title: %d</string>
+ <string id="25006">Select playback item</string>
<!-- strings 29800 thru 29998 reserved strings used only in the default Project Mayhem III skin and not c++ code -->
<string id="29800">Library Mode</string>
View
2  project/VS2010Express/XBMC.vcxproj
@@ -346,6 +346,7 @@
<ClCompile Include="..\..\xbmc\filesystem\AFPDirectory.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\AFPFile.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\ASAPFileDirectory.cpp" />
+ <ClCompile Include="..\..\xbmc\filesystem\BlurayDirectory.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\CacheStrategy.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\CDDADirectory.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\CDDAFile.cpp" />
@@ -907,6 +908,7 @@
<ClInclude Include="..\..\xbmc\filesystem\AFPDirectory.h" />
<ClInclude Include="..\..\xbmc\filesystem\AFPFile.h" />
<ClInclude Include="..\..\xbmc\filesystem\ASAPFileDirectory.h" />
+ <ClInclude Include="..\..\xbmc\filesystem\BlurayDirectory.h" />
<ClInclude Include="..\..\xbmc\filesystem\CacheStrategy.h" />
<ClInclude Include="..\..\xbmc\filesystem\CDDADirectory.h" />
<ClInclude Include="..\..\xbmc\filesystem\CDDAFile.h" />
View
6 project/VS2010Express/XBMC.vcxproj.filters
@@ -2345,6 +2345,9 @@
<ClCompile Include="..\..\xbmc\filesystem\ASAPFileDirectory.cpp">
<Filter>filesystem</Filter>
</ClCompile>
+ <ClCompile Include="..\..\xbmc\filesystem\BlurayDirectory.cpp">
+ <Filter>filesystem</Filter>
+ </ClCompile>
<ClCompile Include="..\..\xbmc\filesystem\CacheStrategy.cpp">
<Filter>filesystem</Filter>
</ClCompile>
@@ -5206,6 +5209,9 @@
<ClInclude Include="..\..\xbmc\filesystem\FileCache.h">
<Filter>filesystem</Filter>
</ClInclude>
+ <ClInclude Include="..\..\xbmc\filesystem\BlurayDirectory.h">
+ <Filter>filesystem</Filter>
+ </ClInclude>
<ClInclude Include="..\..\xbmc\utils\Base64.h">
<Filter>utils</Filter>
</ClInclude>
View
2  xbmc/FileItem.cpp
@@ -2859,6 +2859,7 @@ CStdString CFileItem::GetLocalFanart() const
// no local fanart available for these
if (IsInternetStream()
|| URIUtils::IsUPnP(strFile)
+ || URIUtils::IsBluray(strFile)
|| IsLiveTV()
|| IsPlugin()
|| IsAddonsPath()
@@ -3119,6 +3120,7 @@ CStdString CFileItem::FindTrailer() const
// no local trailer available for these
if (IsInternetStream()
|| URIUtils::IsUPnP(strFile)
+ || URIUtils::IsBluray(strFile)
|| IsLiveTV()
|| IsPlugin()
|| IsDVD())
View
1  xbmc/Util.cpp
@@ -1258,6 +1258,7 @@ CStdString CUtil::ValidatePath(const CStdString &path, bool bFixDoubleSlashes /*
path.Left(4).Equals("zip:") ||
path.Left(4).Equals("rar:") ||
path.Left(6).Equals("stack:") ||
+ path.Left(7).Equals("bluray:") ||
path.Left(10).Equals("multipath:") ))
return result;
View
2  xbmc/cores/dvdplayer/DVDInputStreams/DVDFactoryInputStream.cpp
@@ -53,7 +53,7 @@ CDVDInputStream* CDVDFactoryInputStream::CreateInputStream(IDVDPlayer* pPlayer,
return (new CDVDInputStreamNavigator(pPlayer));
}
#ifdef HAVE_LIBBLURAY
- else if (item.IsType(".bdmv") || item.IsType(".mpls") || content == "bluray/iso")
+ else if (item.IsType(".bdmv") || item.IsType(".mpls") || content == "bluray/iso" || file.substr(0, 7) == "bluray:")
return new CDVDInputStreamBluray(pPlayer);
#endif
else if(file.substr(0, 6) == "rtp://"
View
38 xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.cpp
@@ -273,20 +273,34 @@ bool CDVDInputStreamBluray::Open(const char* strFile, const std::string& content
if(m_player == NULL)
return false;
- CStdString strPath;
- URIUtils::GetDirectory(strFile,strPath);
- URIUtils::RemoveSlashAtEnd(strPath);
+ CStdString strPath(strFile);
+ CStdString filename;
+ CStdString root;
- if(URIUtils::GetFileName(strPath) == "PLAYLIST")
+ if(strPath.Left(7).Equals("bluray:"))
{
- URIUtils::GetDirectory(strPath,strPath);
- URIUtils::RemoveSlashAtEnd(strPath);
+ CURL url(strPath);
+ root = url.GetHostName();
+ filename = URIUtils::GetFileName(url.GetFileName());
}
-
- if(URIUtils::GetFileName(strPath) == "BDMV")
+ else
{
URIUtils::GetDirectory(strPath,strPath);
URIUtils::RemoveSlashAtEnd(strPath);
+
+ if(URIUtils::GetFileName(strPath) == "PLAYLIST")
+ {
+ URIUtils::GetDirectory(strPath,strPath);
+ URIUtils::RemoveSlashAtEnd(strPath);
+ }
+
+ if(URIUtils::GetFileName(strPath) == "BDMV")
+ {
+ URIUtils::GetDirectory(strPath,strPath);
+ URIUtils::RemoveSlashAtEnd(strPath);
+ }
+ root = strPath;
+ filename = URIUtils::GetFileName(strFile);
}
if (!m_dll)
@@ -297,12 +311,12 @@ bool CDVDInputStreamBluray::Open(const char* strFile, const std::string& content
m_dll->bd_set_debug_handler(DllLibbluray::bluray_logger);
m_dll->bd_set_debug_mask(DBG_CRIT | DBG_BLURAY | DBG_NAV);
- CLog::Log(LOGDEBUG, "CDVDInputStreamBluray::Open - opening %s", strPath.c_str());
- m_bd = m_dll->bd_open(strPath.c_str(), NULL);
+ CLog::Log(LOGDEBUG, "CDVDInputStreamBluray::Open - opening %s", root.c_str());
+ m_bd = m_dll->bd_open(root.c_str(), NULL);
if(!m_bd)
{
- CLog::Log(LOGERROR, "CDVDInputStreamBluray::Open - failed to open %s", strPath.c_str());
+ CLog::Log(LOGERROR, "CDVDInputStreamBluray::Open - failed to open %s", root.c_str());
return false;
}
@@ -345,8 +359,6 @@ bool CDVDInputStreamBluray::Open(const char* strFile, const std::string& content
return false;
}
-
- CStdString filename = URIUtils::GetFileName(strFile);
if(filename.Equals("index.bdmv"))
{
m_navmode = false;
View
185 xbmc/filesystem/BlurayDirectory.cpp
@@ -0,0 +1,185 @@
+/*
+ * Copyright (C) 2005-2008 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "BlurayDirectory.h"
+#include "utils/log.h"
+#include "utils/URIUtils.h"
+#include "URL.h"
+#include "DllLibbluray.h"
+#include "FileItem.h"
+#include "video/VideoInfoTag.h"
+#include "guilib/LocalizeStrings.h"
+
+namespace XFILE
+{
+
+#define MAIN_TITLE_LENGTH_PERCENT 70 /** Minumum length of main titles, based on longest title */
+
+CBlurayDirectory::CBlurayDirectory()
+ : m_dll(NULL)
+ , m_bd(NULL)
+{
+}
+
+CBlurayDirectory::~CBlurayDirectory()
+{
+ Dispose();
+}
+
+void CBlurayDirectory::Dispose()
+{
+ if(m_bd)
+ {
+ m_dll->bd_close(m_bd);
+ m_bd = NULL;
+ }
+ delete m_dll;
+ m_dll = NULL;
+}
+
+CFileItemPtr CBlurayDirectory::GetTitle(const BLURAY_TITLE_INFO* title, const CStdString& label)
+{
+ CStdString buf;
+ CFileItemPtr item(new CFileItem("", false));
+ CURL path(m_url);
+ buf.Format("BDMV/PLAYLIST/%05d.mpls", title->playlist);
+ path.SetFileName(buf);
+ item->SetPath(path.Get());
+ item->GetVideoInfoTag()->m_strRuntime.Format("%d",title->duration / 90000);
+ item->GetVideoInfoTag()->m_iTrack = title->playlist;
+ buf.Format(label.c_str(), title->playlist);
+ item->m_strTitle = buf;
+ item->SetLabel(buf);
+ item->m_dwSize = 0;
+ item->SetIconImage("DefaultVideo.png");
+ for(unsigned int i = 0; i < title->clip_count; ++i)
+ item->m_dwSize += title->clips[i].pkt_count * 192;
+
+ return item;
+}
+
+void CBlurayDirectory::GetTitles(bool main, CFileItemList &items)
+{
+ unsigned titles = m_dll->bd_get_titles(m_bd, TITLES_RELEVANT, 0);
+ CStdString buf;
+
+ std::vector<BLURAY_TITLE_INFO*> buffer;
+
+ uint64_t duration = 0;
+
+ for(unsigned i=0; i < titles; i++)
+ {
+ BLURAY_TITLE_INFO *t = m_dll->bd_get_title_info(m_bd, i, 0);
+ if(!t)
+ {
+ CLog::Log(LOGDEBUG, "CBlurayDirectory - unable to get title %d", i);
+ continue;
+ }
+ if(t->duration > duration)
+ duration = t->duration;
+
+ buffer.push_back(t);
+ }
+
+ if(main)
+ duration = duration * MAIN_TITLE_LENGTH_PERCENT / 100;
+ else
+ duration = 0;
+
+ for(std::vector<BLURAY_TITLE_INFO*>::iterator it = buffer.begin(); it != buffer.end(); ++it)
+ {
+ if((*it)->duration < duration)
+ continue;
+ items.Add(GetTitle(*it, main ? g_localizeStrings.Get(25004) /* Main Title */ : g_localizeStrings.Get(25005) /* Title */));
+ }
+
+
+ for(std::vector<BLURAY_TITLE_INFO*>::iterator it = buffer.begin(); it != buffer.end(); ++it)
+ m_dll->bd_free_title_info(*it);
+}
+
+void CBlurayDirectory::GetRoot(CFileItemList &items)
+{
+ GetTitles(true, items);
+
+ CURL path(m_url);
+ CFileItemPtr item;
+
+ path.SetFileName(URIUtils::AddFileToFolder(m_url.GetFileName(), "titles"));
+ item.reset(new CFileItem());
+ item->SetPath(path.Get());
+ item->m_bIsFolder = true;
+ item->SetLabel(g_localizeStrings.Get(25002) /* All titles */);
+ item->SetIconImage("DefaultVideoPlaylists.png");
+ items.Add(item);
+
+ path.SetFileName("BDMV/MovieObject.bdmv");
+ item.reset(new CFileItem());
+ item->SetPath(path.Get());
+ item->m_bIsFolder = false;
+ item->SetLabel(g_localizeStrings.Get(25003) /* Menus */);
+ item->SetIconImage("DefaultProgram.png");
+ items.Add(item);
+}
+
+bool CBlurayDirectory::GetDirectory(const CStdString& path, CFileItemList &items)
+{
+ Dispose();
+ m_url.Parse(path);
+ CStdString root = m_url.GetHostName();
+ CStdString file = m_url.GetFileName();
+ URIUtils::RemoveSlashAtEnd(file);
+
+ m_dll = new DllLibbluray();
+ if (!m_dll->Load())
+ {
+ CLog::Log(LOGERROR, "CBlurayDirectory::GetDirectory - failed to load dll");
+ return false;
+ }
+
+ m_dll->bd_register_dir(DllLibbluray::dir_open);
+ m_dll->bd_register_file(DllLibbluray::file_open);
+ m_dll->bd_set_debug_handler(DllLibbluray::bluray_logger);
+ m_dll->bd_set_debug_mask(DBG_CRIT | DBG_BLURAY | DBG_NAV);
+
+ m_bd = m_dll->bd_open(root.c_str(), NULL);
+
+ if(!m_bd)
+ {
+ CLog::Log(LOGERROR, "CBlurayDirectory::GetDirectory - failed to open %s", root.c_str());
+ return false;
+ }
+
+ if(file == "")
+ GetRoot(items);
+ else if(file == "titles")
+ GetTitles(false, items);
+ else
+ return false;
+
+ items.AddSortMethod(SORT_METHOD_TRACKNUM , 554, LABEL_MASKS("%L", "%D", "%L", "")); // FileName, Duration | Foldername, empty
+ items.AddSortMethod(SORT_METHOD_SIZE , 553, LABEL_MASKS("%L", "%I", "%L", "%I")); // FileName, Size | Foldername, Size
+
+ return true;
+}
+
+
+} /* namespace XFILE */
View
53 xbmc/filesystem/BlurayDirectory.h
@@ -0,0 +1,53 @@
+#pragma once
+
+/*
+ * Copyright (C) 2005-2008 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "Directory.h"
+#include "FileItem.h"
+#include "URL.h"
+
+class DllLibbluray;
+typedef struct bluray BLURAY;
+typedef struct bd_title_info BLURAY_TITLE_INFO;
+
+namespace XFILE
+{
+
+class CBlurayDirectory: public XFILE::IDirectory
+{
+public:
+ CBlurayDirectory();
+ virtual ~CBlurayDirectory();
+ virtual bool GetDirectory(const CStdString& path, CFileItemList &items);
+
+private:
+
+ void Dispose();
+ void GetRoot (CFileItemList &items);
+ void GetTitles(bool main, CFileItemList &items);
+ CFileItemPtr GetTitle(const BLURAY_TITLE_INFO* title, const CStdString& label);
+ CURL m_url;
+ DllLibbluray* m_dll;
+ BLURAY* m_bd;
+};
+
+}
View
6 xbmc/filesystem/DirectoryFactory.cpp
@@ -100,6 +100,9 @@
#ifdef HAS_FILESYSTEM_AFP
#include "AFPDirectory.h"
#endif
+#ifdef HAVE_LIBBLURAY
+#include "BlurayDirectory.h"
+#endif
using namespace XFILE;
@@ -198,6 +201,9 @@ IDirectory* CDirectoryFactory::Create(const CStdString& strPath)
#ifdef HAS_FILESYSTEM_AFP
if (strProtocol == "afp") return new CAFPDirectory();
#endif
+#ifdef HAVE_LIBBLURAY
+ if (strProtocol == "bluray") return new CBlurayDirectory();
+#endif
}
CLog::Log(LOGWARNING, "%s - Unsupported protocol(%s) in %s", __FUNCTION__, strProtocol.c_str(), url.Get().c_str() );
View
4 xbmc/filesystem/Makefile.in
@@ -112,6 +112,10 @@ SRCS+=AFPFile.cpp
SRCS+=AFPDirectory.cpp
endif
+ifeq (@HAVE_LIBBLURAY@,1)
+SRCS+=BlurayDirectory.cpp
+endif
+
INCLUDES+=-I@abs_top_srcdir@/lib/libUPnP/Platinum/Source/Core \
-I@abs_top_srcdir@/lib/libUPnP/Platinum/Source/Platinum \
-I@abs_top_srcdir@/lib/libUPnP/Platinum/Source/Devices/MediaServer \
View
8 xbmc/utils/URIUtils.cpp
@@ -231,7 +231,8 @@ void URIUtils::GetCommonPath(CStdString& strParent, const CStdString& strPath)
bool URIUtils::ProtocolHasParentInHostname(const CStdString& prot)
{
return prot.Equals("zip")
- || prot.Equals("rar");
+ || prot.Equals("rar")
+ || prot.Equals("bluray");
}
bool URIUtils::ProtocolHasEncodedHostname(const CStdString& prot)
@@ -777,6 +778,11 @@ bool URIUtils::IsLastFM(const CStdString& strFile)
return strFile.Left(7).Equals("lastfm:");
}
+bool URIUtils::IsBluray(const CStdString& strFile)
+{
+ return strFile.Left(7).Equals("bluray:");
+}
+
bool URIUtils::IsDOSPath(const CStdString &path)
{
if (path.size() > 1 && path[1] == ':' && isalpha(path[0]))
View
1  xbmc/utils/URIUtils.h
@@ -88,6 +88,7 @@ class URIUtils
static bool IsVideoDb(const CStdString& strFile);
static bool IsVTP(const CStdString& strFile);
static bool IsZIP(const CStdString& strFile);
+ static bool IsBluray(const CStdString& strFile);
static void AddSlashAtEnd(CStdString& strFolder);
static bool HasSlashAtEnd(const CStdString& strFile);
View
74 xbmc/video/windows/GUIWindowVideoBase.cpp
@@ -1048,6 +1048,77 @@ bool CGUIWindowVideoBase::ShowResumeMenu(CFileItem &item)
return true;
}
+bool CGUIWindowVideoBase::ShowPlaySelection(CFileItemPtr& item)
+{
+ /* if asked to resume somewhere, we should not show anything */
+ if (item->m_lStartOffset)
+ return true;
+
+ if (item->IsBDFile())
+ {
+ CStdString root = URIUtils::GetParentPath(item->GetPath());
+ URIUtils::RemoveSlashAtEnd(root);
+ if(URIUtils::GetFileName(root) == "BDMV")
+ {
+ CURL url("bluray://");
+ url.SetHostName(URIUtils::GetParentPath(root));
+ return ShowPlaySelection(item, url.Get());
+ }
+ }
+
+ return true;
+}
+
+bool CGUIWindowVideoBase::ShowPlaySelection(CFileItemPtr& item, const CStdString& directory)
+{
+
+ CFileItemList items;
+
+ if (!XFILE::CDirectory::GetDirectory(directory, items, XFILE::CDirectory::CHints(), true))
+ {
+ CLog::Log(LOGERROR, "CGUIWindowVideoBase::ShowPlaySelection - Failed to get play directory for %s", directory.c_str());
+ return true;
+ }
+
+ if (items.Size() == 0)
+ {
+ CLog::Log(LOGERROR, "CGUIWindowVideoBase::ShowPlaySelection - Failed to get any items %s", directory.c_str());
+ return true;
+ }
+
+ CGUIDialogSelect* dialog = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);
+ while(true)
+ {
+ dialog->Reset();
+ dialog->SetHeading(25006 /* Select playback item */);
+ dialog->SetItems(&items);
+ dialog->SetUseDetails(true);
+ dialog->DoModal();
+
+ CFileItemPtr item_new = dialog->GetSelectedItem();
+ if(!item_new || dialog->GetSelectedLabel() < 0)
+ {
+ CLog::Log(LOGDEBUG, "CGUIWindowVideoBase::ShowPlaySelection - User aborted %s", directory.c_str());
+ break;
+ }
+
+ if(item_new->m_bIsFolder == false)
+ {
+ item = item_new;
+ return true;
+ }
+
+ items.Clear();
+ if(!XFILE::CDirectory::GetDirectory(item_new->GetPath(), items, XFILE::CDirectory::CHints(), true) || items.Size() == 0)
+ {
+ CLog::Log(LOGERROR, "CGUIWindowVideoBase::ShowPlaySelection - Failed to get any items %s", item_new->GetPath().c_str());
+ break;
+ }
+ }
+
+ return false;
+}
+
bool CGUIWindowVideoBase::OnResumeItem(int iItem)
{
if (iItem < 0 || iItem >= m_vecItems->Size()) return true;
@@ -1418,6 +1489,9 @@ void CGUIWindowVideoBase::PlayMovie(const CFileItem *item)
{
CFileItemPtr movieItem(new CFileItem(*item));
+ if(!ShowPlaySelection(movieItem))
+ return;
+
g_playlistPlayer.Reset();
g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_VIDEO);
CPlayList& playlist = g_playlistPlayer.GetPlaylist(PLAYLIST_VIDEO);
View
5 xbmc/video/windows/GUIWindowVideoBase.h
@@ -43,6 +43,11 @@ class CGUIWindowVideoBase : public CGUIMediaWindow, public IBackgroundLoaderObse
static void MarkWatched(const CFileItemPtr &pItem, bool bMark);
static void UpdateVideoTitle(const CFileItem* pItem);
+ /*! \brief Show dialog allowing selection of wanted playback item */
+ static bool ShowPlaySelection(CFileItemPtr& item);
+ static bool ShowPlaySelection(CFileItemPtr& item, const CStdString& directory);
+
+
/*! \brief Show the resume menu for this item (if it has a resume bookmark)
If a resume bookmark is found, we set the item's m_lStartOffset to STARTOFFSET_RESUME
\param item item to check for a resume bookmark
Something went wrong with that request. Please try again.