xbmc: add a handfull (or better two hands full) upstream patches

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2011-12-31 00:54:31 +01:00
parent ca743de6ea
commit 06f0d9dc5f
9 changed files with 805 additions and 0 deletions

View File

@ -0,0 +1,121 @@
From 71a2ad0ebd13e0e2d5e830170705f9290cd06c51 Mon Sep 17 00:00:00 2001
From: Lee Pollock <scudlee@gmail.com>
Date: Tue, 29 Nov 2011 19:01:56 +0000
Subject: [PATCH] Rearrange Autorun.cpp so audio cds actually play on
PlayDVD()
---
xbmc/Autorun.cpp | 52 ++++++++++++++++++++++++++++++++--------------------
xbmc/Autorun.h | 2 +-
2 files changed, 33 insertions(+), 21 deletions(-)
diff --git a/xbmc/Autorun.cpp b/xbmc/Autorun.cpp
index 292c66d..f7ae918 100644
--- a/xbmc/Autorun.cpp
+++ b/xbmc/Autorun.cpp
@@ -69,38 +69,25 @@ void CAutorun::ExecuteAutorun( bool bypassSettings, bool ignoreplaying, bool sta
g_application.ResetScreenSaver();
g_application.WakeUpScreenSaverAndDPMS(); // turn off the screensaver if it's active
- if ( pInfo->IsAudio( 1 ) )
- {
- if( !bypassSettings && !g_guiSettings.GetBool("audiocds.autorun") )
- return;
-
- if (!g_passwordManager.IsMasterLockUnlocked(false))
- if (g_settings.GetCurrentProfile().musicLocked())
- return ;
-
- RunCdda();
- }
- else
- {
- RunMedia(bypassSettings, startFromBeginning);
- }
+ RunMedia(bypassSettings, startFromBeginning);
}
-void CAutorun::RunCdda()
+bool CAutorun::RunCdda()
{
CFileItemList vecItems;
auto_ptr<IDirectory> pDir ( CFactoryDirectory::Create( "cdda://local/" ) );
if ( !pDir->GetDirectory( "cdda://local/", vecItems ) )
- return ;
+ return false;
if ( vecItems.Size() <= 0 )
- return ;
+ return false;
g_playlistPlayer.ClearPlaylist(PLAYLIST_MUSIC);
g_playlistPlayer.Add(PLAYLIST_MUSIC, vecItems);
g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_MUSIC);
g_playlistPlayer.Play();
+ return true;
}
void CAutorun::RunMedia(bool bypassSettings, bool startFromBeginning)
@@ -167,8 +154,22 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded
// is this a root folder we have to check the content to determine a disc type
if( bRoot )
{
+ // check for audio cd first
+ CCdInfo* pInfo = g_mediaManager.GetCdInfo();
+
+ if ( pInfo->IsAudio( 1 ) )
+ {
+ if( !bypassSettings && !g_guiSettings.GetBool("audiocds.autorun") )
+ return false;
- // check root folders first, for normal structured dvd's
+ if (!g_passwordManager.IsMasterLockUnlocked(false))
+ if (g_settings.GetCurrentProfile().musicLocked())
+ return false;
+ bPlaying = RunCdda();
+ return bPlaying;
+ }
+
+ // check root folders next, for normal structured dvd's
for (int i = 0; i < vecItems.Size(); i++)
{
CFileItemPtr pItem = vecItems[i];
@@ -390,9 +391,20 @@ bool CAutorun::IsEnabled() const
bool CAutorun::PlayDisc(const CStdString& path, bool startFromBeginning)
{
+ int nSize = g_playlistPlayer.GetPlaylist( PLAYLIST_MUSIC ).size();
int nAddedToPlaylist = 0;
auto_ptr<IDirectory> pDir ( CFactoryDirectory::Create( path ));
- return RunDisc(pDir.get(), path, nAddedToPlaylist, true, true, startFromBeginning);
+ bool bPlaying = RunDisc(pDir.get(), path, nAddedToPlaylist, true, true, startFromBeginning);
+ if ( !bPlaying && nAddedToPlaylist > 0 )
+ {
+ CGUIMessage msg( GUI_MSG_PLAYLIST_CHANGED, 0, 0 );
+ g_windowManager.SendMessage( msg );
+ g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_MUSIC);
+ // Start playing the items we inserted
+ g_playlistPlayer.Play(nSize);
+ bPlaying = true;
+ }
+ return bPlaying;
}
bool CAutorun::PlayDiscAskResume(const CStdString& path)
diff --git a/xbmc/Autorun.h b/xbmc/Autorun.h
index 39f34ae..7280d9d 100644
--- a/xbmc/Autorun.h
+++ b/xbmc/Autorun.h
@@ -56,7 +56,7 @@ class CAutorun
void HandleAutorun();
static void ExecuteAutorun(bool bypassSettings = false, bool ignoreplaying = false, bool startFromBeginning = false);
protected:
- static void RunCdda();
+ static bool RunCdda();
static void RunMedia(bool bypassSettings, bool startFromBeginning);
static bool RunDisc(XFILE::IDirectory* pDir, const CStdString& strDrive, int& nAddedToPlaylist, bool bRoot, bool bypassSettings, bool startFromBeginning);
bool m_bEnable;
--
1.7.5.4

View File

@ -0,0 +1,228 @@
From 89135dd485e785fc4fa43e6919d9920696bc1f41 Mon Sep 17 00:00:00 2001
From: Voyager-xbmc <patrick.middag@telenet.be>
Date: Sun, 25 Dec 2011 21:00:27 +0100
Subject: [PATCH] Fixed resume function on DVD discs and refactoring PlayDisc
to include/replace RunMedia functionality
---
xbmc/Application.cpp | 8 +++--
xbmc/Autorun.cpp | 65 +++++++++++++--------------------
xbmc/Autorun.h | 5 +--
xbmc/dialogs/GUIDialogContextMenu.cpp | 4 +-
xbmc/interfaces/Builtins.cpp | 2 +-
xbmc/utils/SaveFileStateJob.h | 7 ++--
6 files changed, 39 insertions(+), 52 deletions(-)
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 6c12234..99c4e6c 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -3544,7 +3544,9 @@ bool CApplication::PlayFile(const CFileItem& item, bool bRestart)
#ifdef HAS_DVD_DRIVE
// Display the Play Eject dialog
if (CGUIDialogPlayEject::ShowAndGetInput(item))
- return MEDIA_DETECT::CAutorun::PlayDiscAskResume(item.GetPath());
+ // PlayDiscAskResume takes path to disc. No parameter means default DVD drive.
+ // Can't do better as CGUIDialogPlayEject calls CMediaManager::IsDiscInDrive, which assumes default DVD drive anyway
+ return MEDIA_DETECT::CAutorun::PlayDiscAskResume();
#endif
return true;
}
@@ -3640,9 +3642,9 @@ bool CApplication::PlayFile(const CFileItem& item, bool bRestart)
options.starttime = 0.0f;
CBookmark bookmark;
CStdString path = item.GetPath();
- if (item.IsDVD())
+ if (item.HasVideoInfoTag() && item.GetVideoInfoTag()->m_strFileNameAndPath.Find("removable://") == 0)
path = item.GetVideoInfoTag()->m_strFileNameAndPath;
- if (item.HasProperty("original_listitem_url") && URIUtils::IsPlugin(item.GetProperty("original_listitem_url").asString()))
+ else if (item.HasProperty("original_listitem_url") && URIUtils::IsPlugin(item.GetProperty("original_listitem_url").asString()))
path = item.GetProperty("original_listitem_url").asString();
if(dbs.GetResumeBookMark(path, bookmark))
{
diff --git a/xbmc/Autorun.cpp b/xbmc/Autorun.cpp
index f7ae918..8eef37e 100644
--- a/xbmc/Autorun.cpp
+++ b/xbmc/Autorun.cpp
@@ -69,7 +69,7 @@ void CAutorun::ExecuteAutorun( bool bypassSettings, bool ignoreplaying, bool sta
g_application.ResetScreenSaver();
g_application.WakeUpScreenSaverAndDPMS(); // turn off the screensaver if it's active
- RunMedia(bypassSettings, startFromBeginning);
+ PlayDisc("", bypassSettings, startFromBeginning);
}
bool CAutorun::RunCdda()
@@ -90,42 +90,47 @@ bool CAutorun::RunCdda()
return true;
}
-void CAutorun::RunMedia(bool bypassSettings, bool startFromBeginning)
+bool CAutorun::PlayDisc(const CStdString& path, bool bypassSettings, bool startFromBeginning)
{
if ( !bypassSettings && !g_guiSettings.GetBool("audiocds.autorun") && !g_guiSettings.GetBool("dvds.autorun"))
- return ;
+ return false;
int nSize = g_playlistPlayer.GetPlaylist( PLAYLIST_MUSIC ).size();
int nAddedToPlaylist = 0;
-#ifdef _WIN32
- auto_ptr<IDirectory> pDir ( CFactoryDirectory::Create( g_mediaManager.TranslateDevicePath("") ));
- bool bPlaying = RunDisc(pDir.get(), g_mediaManager.TranslateDevicePath(""), nAddedToPlaylist, true, bypassSettings, startFromBeginning);
-#else
- CCdInfo* pInfo = g_mediaManager.GetCdInfo();
- if ( pInfo == NULL )
- return ;
+ CStdString mediaPath = path;
- bool bPlaying;
- if (pInfo->IsISOUDF(1) || pInfo->IsISOHFS(1) || pInfo->IsIso9660(1) || pInfo->IsIso9660Interactive(1))
- {
- auto_ptr<IDirectory> pDir ( CFactoryDirectory::Create( "iso9660://" ));
- bPlaying = RunDisc(pDir.get(), "iso9660://", nAddedToPlaylist, true, bypassSettings, startFromBeginning);
- }
- else
+#ifdef _WIN32
+ if (mediaPath.IsEmpty())
+ mediaPath = g_mediaManager.TranslateDevicePath("");
+
+#else
+ if (mediaPath.IsEmpty())
{
- auto_ptr<IDirectory> pDir ( CFactoryDirectory::Create( "D:\\" ) );
- bPlaying = RunDisc(pDir.get(), "D:\\", nAddedToPlaylist, true, bypassSettings, startFromBeginning);
+ CCdInfo* pInfo = g_mediaManager.GetCdInfo();
+ if ( pInfo == NULL )
+ return false;
+
+ if (pInfo->IsISOUDF(1) || pInfo->IsISOHFS(1) || pInfo->IsIso9660(1) || pInfo->IsIso9660Interactive(1))
+ mediaPath = "iso9660://";
+ else
+ mediaPath = "D:\\"; // Is this XBOX remnant??
}
#endif
+
+ auto_ptr<IDirectory> pDir ( CFactoryDirectory::Create( mediaPath ));
+ bool bPlaying = RunDisc(pDir.get(), mediaPath, nAddedToPlaylist, true, bypassSettings, startFromBeginning);
+
if ( !bPlaying && nAddedToPlaylist > 0 )
{
CGUIMessage msg( GUI_MSG_PLAYLIST_CHANGED, 0, 0 );
g_windowManager.SendMessage( msg );
g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_MUSIC);
// Start playing the items we inserted
- g_playlistPlayer.Play(nSize);
+ return g_playlistPlayer.Play(nSize);
}
+
+ return bPlaying;
}
/**
@@ -389,27 +394,9 @@ bool CAutorun::IsEnabled() const
return m_bEnable;
}
-bool CAutorun::PlayDisc(const CStdString& path, bool startFromBeginning)
-{
- int nSize = g_playlistPlayer.GetPlaylist( PLAYLIST_MUSIC ).size();
- int nAddedToPlaylist = 0;
- auto_ptr<IDirectory> pDir ( CFactoryDirectory::Create( path ));
- bool bPlaying = RunDisc(pDir.get(), path, nAddedToPlaylist, true, true, startFromBeginning);
- if ( !bPlaying && nAddedToPlaylist > 0 )
- {
- CGUIMessage msg( GUI_MSG_PLAYLIST_CHANGED, 0, 0 );
- g_windowManager.SendMessage( msg );
- g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_MUSIC);
- // Start playing the items we inserted
- g_playlistPlayer.Play(nSize);
- bPlaying = true;
- }
- return bPlaying;
-}
-
bool CAutorun::PlayDiscAskResume(const CStdString& path)
{
- return PlayDisc(path, !CanResumePlayDVD(path) || CGUIDialogYesNo::ShowAndGetInput(341, -1, -1, -1, 13404, 12021));
+ return PlayDisc(path, true, !CanResumePlayDVD(path) || CGUIDialogYesNo::ShowAndGetInput(341, -1, -1, -1, 13404, 12021));
}
bool CAutorun::CanResumePlayDVD(const CStdString& path)
diff --git a/xbmc/Autorun.h b/xbmc/Autorun.h
index 7280d9d..693476e 100644
--- a/xbmc/Autorun.h
+++ b/xbmc/Autorun.h
@@ -48,8 +48,8 @@ class CAutorun
CAutorun();
virtual ~CAutorun();
static bool CanResumePlayDVD(const CStdString& path);
- static bool PlayDisc(const CStdString& path, bool startFromBeginning);
- static bool PlayDiscAskResume(const CStdString& path);
+ static bool PlayDisc(const CStdString& path="", bool bypassSettings = false, bool startFromBeginning = false);
+ static bool PlayDiscAskResume(const CStdString& path="");
bool IsEnabled() const;
void Enable();
void Disable();
@@ -57,7 +57,6 @@ class CAutorun
static void ExecuteAutorun(bool bypassSettings = false, bool ignoreplaying = false, bool startFromBeginning = false);
protected:
static bool RunCdda();
- static void RunMedia(bool bypassSettings, bool startFromBeginning);
static bool RunDisc(XFILE::IDirectory* pDir, const CStdString& strDrive, int& nAddedToPlaylist, bool bRoot, bool bypassSettings, bool startFromBeginning);
bool m_bEnable;
};
diff --git a/xbmc/dialogs/GUIDialogContextMenu.cpp b/xbmc/dialogs/GUIDialogContextMenu.cpp
index 1d28a76..092591a 100644
--- a/xbmc/dialogs/GUIDialogContextMenu.cpp
+++ b/xbmc/dialogs/GUIDialogContextMenu.cpp
@@ -393,10 +393,10 @@ bool CGUIDialogContextMenu::OnContextButton(const CStdString &type, const CFileI
#ifdef HAS_DVD_DRIVE
case CONTEXT_BUTTON_PLAY_DISC:
- return MEDIA_DETECT::CAutorun::PlayDisc(item->GetPath(), true); // restart
+ return MEDIA_DETECT::CAutorun::PlayDisc(item->GetPath(), true, true); // restart
case CONTEXT_BUTTON_RESUME_DISC:
- return MEDIA_DETECT::CAutorun::PlayDisc(item->GetPath(), false);// resume
+ return MEDIA_DETECT::CAutorun::PlayDisc(item->GetPath(), true, false); // resume
case CONTEXT_BUTTON_EJECT_DISC:
#ifdef _WIN32
diff --git a/xbmc/interfaces/Builtins.cpp b/xbmc/interfaces/Builtins.cpp
index 2b940d6..2667f69 100644
--- a/xbmc/interfaces/Builtins.cpp
+++ b/xbmc/interfaces/Builtins.cpp
@@ -941,7 +941,7 @@ int CBuiltins::Execute(const CStdString& execString)
bool restart = false;
if (params.size() > 0 && params[0].CompareNoCase("restart") == 0)
restart = true;
- CAutorun::PlayDisc(g_mediaManager.GetDiscPath(), restart);
+ CAutorun::PlayDisc(g_mediaManager.GetDiscPath(), true, restart);
#endif
}
else if (execute.Equals("ripcd"))
diff --git a/xbmc/utils/SaveFileStateJob.h b/xbmc/utils/SaveFileStateJob.h
index 1504a74..534ef4b 100644
--- a/xbmc/utils/SaveFileStateJob.h
+++ b/xbmc/utils/SaveFileStateJob.h
@@ -24,13 +24,12 @@ class CSaveFileStateJob : public CJob
bool CSaveFileStateJob::DoWork()
{
CStdString progressTrackingFile = m_item.GetPath();
- if (m_item.HasProperty("original_listitem_url") &&
+ if (m_item.HasVideoInfoTag() && m_item.GetVideoInfoTag()->m_strFileNameAndPath.Find("removable://") == 0)
+ progressTrackingFile = m_item.GetVideoInfoTag()->m_strFileNameAndPath; // this variable contains removable:// suffixed by disc label+uniqueid or is empty if label not uniquely identified
+ else if (m_item.HasProperty("original_listitem_url") &&
URIUtils::IsPlugin(m_item.GetProperty("original_listitem_url").asString()))
progressTrackingFile = m_item.GetProperty("original_listitem_url").asString();
- if (m_item.IsDVD())
- progressTrackingFile = m_item.GetVideoInfoTag()->m_strFileNameAndPath; // this variable contains removable:// suffixed by disc label+uniqueid or is empty if label not uniquely identified
-
if (progressTrackingFile != "")
{
if (m_item.IsVideo())
--
1.7.5.4

View File

@ -0,0 +1,124 @@
From ee8b61c8687ad6a2c0c58c476b69d1b58364d43c Mon Sep 17 00:00:00 2001
From: elupus <elupus@xbmc.org>
Date: Wed, 28 Dec 2011 22:34:33 +0100
Subject: [PATCH] fixed: cdda/dvd playdisk (attempt 4)
It still needs more work..
---
xbmc/Autorun.cpp | 62 +++++++++++++----------------------------------------
xbmc/Autorun.h | 1 -
2 files changed, 15 insertions(+), 48 deletions(-)
diff --git a/xbmc/Autorun.cpp b/xbmc/Autorun.cpp
index 8eef37e..4f49ff0 100644
--- a/xbmc/Autorun.cpp
+++ b/xbmc/Autorun.cpp
@@ -42,6 +42,7 @@
#include "video/VideoDatabase.h"
#include "dialogs/GUIDialogYesNo.h"
#include "utils/URIUtils.h"
+#include "utils/log.h"
using namespace std;
using namespace XFILE;
@@ -72,24 +73,6 @@ void CAutorun::ExecuteAutorun( bool bypassSettings, bool ignoreplaying, bool sta
PlayDisc("", bypassSettings, startFromBeginning);
}
-bool CAutorun::RunCdda()
-{
- CFileItemList vecItems;
-
- auto_ptr<IDirectory> pDir ( CFactoryDirectory::Create( "cdda://local/" ) );
- if ( !pDir->GetDirectory( "cdda://local/", vecItems ) )
- return false;
-
- if ( vecItems.Size() <= 0 )
- return false;
-
- g_playlistPlayer.ClearPlaylist(PLAYLIST_MUSIC);
- g_playlistPlayer.Add(PLAYLIST_MUSIC, vecItems);
- g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_MUSIC);
- g_playlistPlayer.Play();
- return true;
-}
-
bool CAutorun::PlayDisc(const CStdString& path, bool bypassSettings, bool startFromBeginning)
{
if ( !bypassSettings && !g_guiSettings.GetBool("audiocds.autorun") && !g_guiSettings.GetBool("dvds.autorun"))
@@ -98,24 +81,24 @@ bool CAutorun::PlayDisc(const CStdString& path, bool bypassSettings, bool startF
int nSize = g_playlistPlayer.GetPlaylist( PLAYLIST_MUSIC ).size();
int nAddedToPlaylist = 0;
- CStdString mediaPath = path;
+ CStdString mediaPath;
+
+ CCdInfo* pInfo = g_mediaManager.GetCdInfo(path);
+ if (pInfo == NULL)
+ return false;
+
+ if (mediaPath.IsEmpty() && pInfo->IsAudio(1))
+ mediaPath = "cdda://local/";
+
+ if (mediaPath.IsEmpty() && (pInfo->IsISOUDF(1) || pInfo->IsISOHFS(1) || pInfo->IsIso9660(1) || pInfo->IsIso9660Interactive(1)))
+ mediaPath = "iso9660://";
-#ifdef _WIN32
if (mediaPath.IsEmpty())
- mediaPath = g_mediaManager.TranslateDevicePath("");
+ mediaPath = path;
-#else
+#ifdef _WIN32
if (mediaPath.IsEmpty())
- {
- CCdInfo* pInfo = g_mediaManager.GetCdInfo();
- if ( pInfo == NULL )
- return false;
-
- if (pInfo->IsISOUDF(1) || pInfo->IsISOHFS(1) || pInfo->IsIso9660(1) || pInfo->IsIso9660Interactive(1))
- mediaPath = "iso9660://";
- else
- mediaPath = "D:\\"; // Is this XBOX remnant??
- }
+ mediaPath = g_mediaManager.TranslateDevicePath("");
#endif
auto_ptr<IDirectory> pDir ( CFactoryDirectory::Create( mediaPath ));
@@ -159,21 +142,6 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded
// is this a root folder we have to check the content to determine a disc type
if( bRoot )
{
- // check for audio cd first
- CCdInfo* pInfo = g_mediaManager.GetCdInfo();
-
- if ( pInfo->IsAudio( 1 ) )
- {
- if( !bypassSettings && !g_guiSettings.GetBool("audiocds.autorun") )
- return false;
-
- if (!g_passwordManager.IsMasterLockUnlocked(false))
- if (g_settings.GetCurrentProfile().musicLocked())
- return false;
- bPlaying = RunCdda();
- return bPlaying;
- }
-
// check root folders next, for normal structured dvd's
for (int i = 0; i < vecItems.Size(); i++)
{
diff --git a/xbmc/Autorun.h b/xbmc/Autorun.h
index 693476e..4461b74 100644
--- a/xbmc/Autorun.h
+++ b/xbmc/Autorun.h
@@ -56,7 +56,6 @@ class CAutorun
void HandleAutorun();
static void ExecuteAutorun(bool bypassSettings = false, bool ignoreplaying = false, bool startFromBeginning = false);
protected:
- static bool RunCdda();
static bool RunDisc(XFILE::IDirectory* pDir, const CStdString& strDrive, int& nAddedToPlaylist, bool bRoot, bool bypassSettings, bool startFromBeginning);
bool m_bEnable;
};
--
1.7.5.4

View File

@ -0,0 +1,25 @@
From e441ca60e52ce8bdeb50538ef6b048ee196935e2 Mon Sep 17 00:00:00 2001
From: Voyager-xbmc <patrick.middag@telenet.be>
Date: Thu, 29 Dec 2011 08:34:08 +0100
Subject: [PATCH] Fix remaining dvd resume issue and soft eject problem
---
xbmc/Autorun.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/xbmc/Autorun.cpp b/xbmc/Autorun.cpp
index 4f49ff0..4bd823f 100644
--- a/xbmc/Autorun.cpp
+++ b/xbmc/Autorun.cpp
@@ -97,7 +97,7 @@ bool CAutorun::PlayDisc(const CStdString& path, bool bypassSettings, bool startF
mediaPath = path;
#ifdef _WIN32
- if (mediaPath.IsEmpty())
+ if (mediaPath.IsEmpty() || mediaPath.CompareNoCase("iso9660://") == 0)
mediaPath = g_mediaManager.TranslateDevicePath("");
#endif
--
1.7.5.4

View File

@ -0,0 +1,72 @@
From 38fa2ee5403310b381a6ac35859af4bed0c3e567 Mon Sep 17 00:00:00 2001
From: Rainer Hochecker <fernetmenta@online.de>
Date: Mon, 19 Dec 2011 20:27:13 +0100
Subject: [PATCH] dvdplayer: use selection streams to calculate HasVideo and
HasAudio
---
xbmc/cores/dvdplayer/DVDPlayer.cpp | 12 ++++--------
xbmc/cores/dvdplayer/DVDPlayer.h | 6 +++---
2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp
index 6061909..4e3ea71 100644
--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp
+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -131,7 +131,7 @@ bool CSelectionStreams::Get(StreamType type, CDemuxStream::EFlags flag, Selectio
return false;
}
-int CSelectionStreams::IndexOf(StreamType type, int source, int id)
+int CSelectionStreams::IndexOf(StreamType type, int source, int id) const
{
CSingleLock lock(m_section);
int count = -1;
@@ -153,7 +153,7 @@ int CSelectionStreams::IndexOf(StreamType type, int source, int id)
return -1;
}
-int CSelectionStreams::IndexOf(StreamType type, CDVDPlayer& p)
+int CSelectionStreams::IndexOf(StreamType type, CDVDPlayer& p) const
{
if (p.m_pInputStream && p.m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD))
{
@@ -2255,16 +2255,12 @@ bool CDVDPlayer::IsPaused() const
bool CDVDPlayer::HasVideo() const
{
- if (m_pInputStream)
- {
- if (m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD) || m_CurrentVideo.id >= 0) return true;
- }
- return false;
+ return m_SelectionStreams.Count(STREAM_VIDEO) > 0 ? true : false;
}
bool CDVDPlayer::HasAudio() const
{
- return (m_CurrentAudio.id >= 0);
+ return m_SelectionStreams.Count(STREAM_AUDIO) > 0 ? true : false;
}
bool CDVDPlayer::IsPassthrough() const
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h
index 9ceca9c..4afb5e2 100644
--- a/xbmc/cores/dvdplayer/DVDPlayer.h
+++ b/xbmc/cores/dvdplayer/DVDPlayer.h
@@ -119,9 +119,9 @@ class CSelectionStreams
}
std::vector<SelectionStream> m_Streams;
- int IndexOf (StreamType type, int source, int id);
- int IndexOf (StreamType type, CDVDPlayer& p);
- int Count (StreamType type) { return IndexOf(type, STREAM_SOURCE_NONE, -1) + 1; }
+ int IndexOf (StreamType type, int source, int id) const;
+ int IndexOf (StreamType type, CDVDPlayer& p) const;
+ int Count (StreamType type) const { return IndexOf(type, STREAM_SOURCE_NONE, -1) + 1; }
SelectionStream& Get (StreamType type, int index);
bool Get (StreamType type, CDemuxStream::EFlags flag, SelectionStream& out);
--
1.7.5.4

View File

@ -0,0 +1,28 @@
From 566136bb6a26ed6ef753434f31ef633de449cefc Mon Sep 17 00:00:00 2001
From: CrystalP <CrystalP@xbmc.org>
Date: Sun, 25 Dec 2011 21:34:27 -0500
Subject: [PATCH] fix playback of dvd, dvd iso and video_ts
m_SelectionStreams is empty when playing a DVD or iso image of a dvd.
m_SelectionStreams doesn't contain video streams when playing a video_ts
folder.
---
xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp
index 4e3ea71..b868cd0 100644
--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp
+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -2255,6 +2255,8 @@ bool CDVDPlayer::IsPaused() const
bool CDVDPlayer::HasVideo() const
{
+ if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD)) return true;
+
return m_SelectionStreams.Count(STREAM_VIDEO) > 0 ? true : false;
}
--
1.7.5.4

View File

@ -0,0 +1,54 @@
From 895d659a6accdae7eb668eebe9426e4820f5928a Mon Sep 17 00:00:00 2001
From: vdrfan <vdrfan-nospam-@xbmc.org>
Date: Fri, 30 Dec 2011 00:29:16 +0100
Subject: [PATCH] fixed: service addons are not started after installation
(fixes #12378)
---
xbmc/addons/AddonInstaller.cpp | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/xbmc/addons/AddonInstaller.cpp b/xbmc/addons/AddonInstaller.cpp
index 7de9eee..9272386 100644
--- a/xbmc/addons/AddonInstaller.cpp
+++ b/xbmc/addons/AddonInstaller.cpp
@@ -20,6 +20,7 @@
*/
#include "AddonInstaller.h"
+#include "Service.h"
#include "utils/log.h"
#include "utils/URIUtils.h"
#include "Util.h"
@@ -419,6 +420,14 @@ bool CAddonInstallJob::OnPreInstall()
g_application.getApplicationMessenger().ExecBuiltIn("UnloadSkin", true);
return true;
}
+
+ if (m_addon->Type() == ADDON_SERVICE)
+ {
+ boost::shared_ptr<CService> service = boost::dynamic_pointer_cast<CService>(m_addon);
+ if (service)
+ service->Stop();
+ return true;
+ }
return false;
}
@@ -511,6 +520,13 @@ void CAddonInstallJob::OnPostInstall(bool reloadAddon)
g_application.getApplicationMessenger().ExecBuiltIn("ReloadSkin");
}
}
+
+ if (m_addon->Type() == ADDON_SERVICE)
+ {
+ boost::shared_ptr<CService> service = boost::dynamic_pointer_cast<CService>(m_addon);
+ if (service)
+ service->Start();
+ }
}
void CAddonInstallJob::ReportInstallError(const CStdString& addonID,
--
1.7.5.4

View File

@ -0,0 +1,124 @@
From 825175e4a300ea1409cc288f675c570b2cc4b46a Mon Sep 17 00:00:00 2001
From: elupus <elupus@xbmc.org>
Date: Wed, 28 Dec 2011 21:16:02 +0100
Subject: [PATCH] changed: avoid including Autorun.h all over xbmc
---
xbmc/Application.cpp | 4 +++-
xbmc/Application.h | 8 ++++++--
xbmc/music/windows/GUIWindowMusicSongs.cpp | 1 +
xbmc/pictures/GUIWindowPictures.cpp | 1 +
xbmc/video/windows/GUIWindowVideoBase.cpp | 1 +
xbmc/windows/GUIWindowFileManager.cpp | 1 +
6 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 99c4e6c..1f39273 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -364,10 +364,12 @@
m_bEnableLegacyRes = false;
m_bSystemScreenSaverEnable = false;
m_pInertialScrollingHandler = new CInertialScrollingHandler();
+ m_Autorun = new CAutorun();
}
CApplication::~CApplication(void)
{
+ delete m_Autorun;
delete m_currentStack;
#ifdef HAS_KARAOKE
@@ -4794,7 +4796,7 @@ void CApplication::ProcessSlow()
#ifdef HAS_DVD_DRIVE
// checks whats in the DVD drive and tries to autostart the content (xbox games, dvd, cdda, avi files...)
if (!IsPlayingVideo())
- m_Autorun.HandleAutorun();
+ m_Autorun->HandleAutorun();
#endif
// update upnp server/renderer states
diff --git a/xbmc/Application.h b/xbmc/Application.h
index d4bb9b3..5c08305 100644
--- a/xbmc/Application.h
+++ b/xbmc/Application.h
@@ -38,6 +38,11 @@
typedef boost::shared_ptr<IAddon> AddonPtr;
}
+namespace MEDIA_DETECT
+{
+ class CAutorun;
+}
+
#include "cores/IPlayer.h"
#include "cores/playercorefactory/PlayerCoreFactory.h"
#include "PlayListPlayer.h"
@@ -47,7 +52,6 @@
#ifdef _WIN32
#include "win32/WIN32Util.h"
#endif
-#include "Autorun.h"
#include "video/Bookmark.h"
#include "utils/Stopwatch.h"
#include "ApplicationMessenger.h"
@@ -211,7 +215,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs
#endif
#ifdef HAS_DVD_DRIVE
- MEDIA_DETECT::CAutorun m_Autorun;
+ MEDIA_DETECT::CAutorun* m_Autorun;
#endif
#if !defined(_WIN32) && defined(HAS_DVD_DRIVE)
diff --git a/xbmc/music/windows/GUIWindowMusicSongs.cpp b/xbmc/music/windows/GUIWindowMusicSongs.cpp
index b5c032d..e5e3b7e 100644
--- a/xbmc/music/windows/GUIWindowMusicSongs.cpp
+++ b/xbmc/music/windows/GUIWindowMusicSongs.cpp
@@ -37,6 +37,7 @@
#include "guilib/LocalizeStrings.h"
#include "utils/log.h"
#include "utils/URIUtils.h"
+#include "Autorun.h"
#define CONTROL_BTNVIEWASICONS 2
#define CONTROL_BTNSORTBY 3
diff --git a/xbmc/pictures/GUIWindowPictures.cpp b/xbmc/pictures/GUIWindowPictures.cpp
index 2518976..707faca 100644
--- a/xbmc/pictures/GUIWindowPictures.cpp
+++ b/xbmc/pictures/GUIWindowPictures.cpp
@@ -40,6 +40,7 @@
#include "utils/TimeUtils.h"
#include "utils/log.h"
#include "utils/URIUtils.h"
+#include "Autorun.h"
#define CONTROL_BTNVIEWASICONS 2
#define CONTROL_BTNSORTBY 3
diff --git a/xbmc/video/windows/GUIWindowVideoBase.cpp b/xbmc/video/windows/GUIWindowVideoBase.cpp
index 9f7c6a1..0512ad7 100644
--- a/xbmc/video/windows/GUIWindowVideoBase.cpp
+++ b/xbmc/video/windows/GUIWindowVideoBase.cpp
@@ -65,6 +65,7 @@
#include "GUIUserMessages.h"
#include "addons/Skin.h"
#include "storage/MediaManager.h"
+#include "Autorun.h"
using namespace std;
using namespace XFILE;
diff --git a/xbmc/windows/GUIWindowFileManager.cpp b/xbmc/windows/GUIWindowFileManager.cpp
index 67e5330..e9d8896 100644
--- a/xbmc/windows/GUIWindowFileManager.cpp
+++ b/xbmc/windows/GUIWindowFileManager.cpp
@@ -58,6 +58,7 @@
#include "utils/FileOperationJob.h"
#include "utils/FileUtils.h"
#include "utils/URIUtils.h"
+#include "Autorun.h"
using namespace std;
using namespace XFILE;
--
1.7.5.4

View File

@ -0,0 +1,29 @@
From dda8fc7e4312acc0353c320174a6c7a009b4c57f Mon Sep 17 00:00:00 2001
From: CrystalP <CrystalP@xbmc.org>
Date: Mon, 26 Dec 2011 14:17:03 -0500
Subject: [PATCH] fix crypted dvd playback
with recent changes to playdisc, CDVDInputStreamNavigator::Open now
receives a full path, which must be truncated more completely or libdvdcss
won't be able to decrypt.
---
.../DVDInputStreams/DVDInputStreamNavigator.cpp | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.cpp b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.cpp
index d4cc77b..b9f42ca 100644
--- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.cpp
+++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.cpp
@@ -80,6 +80,9 @@ bool CDVDInputStreamNavigator::Open(const char* strFile, const std::string& cont
{
strDVDFile[strlen(strDVDFile) - 13] = '\0';
}
+ if (strncasecmp(strDVDFile + strlen(strDVDFile) - 8, "VIDEO_TS", 8) == 0)
+ strDVDFile[strlen(strDVDFile) - 9] = '\0';
+
#if defined(__APPLE__) && !defined(__arm__)
// if physical DVDs, libdvdnav wants "/dev/rdiskN" device name for OSX,
// strDVDFile will get realloc'ed and replaced IF this is a physical DVD.
--
1.7.5.4