xbmc-pvr: update to xbmc-pvr-a62f4d4

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2012-01-21 15:14:35 +01:00
parent 72d3c2830a
commit 66ece117bf
44 changed files with 2 additions and 3282 deletions

View File

@ -19,7 +19,7 @@
################################################################################ ################################################################################
PKG_NAME="xbmc-pvr-theme-Confluence" PKG_NAME="xbmc-pvr-theme-Confluence"
PKG_VERSION="84817e6" PKG_VERSION="a62f4d4"
PKG_REV="1" PKG_REV="1"
PKG_ARCH="any" PKG_ARCH="any"
PKG_LICENSE="GPL" PKG_LICENSE="GPL"

View File

@ -19,7 +19,7 @@
################################################################################ ################################################################################
PKG_NAME="xbmc-pvr" PKG_NAME="xbmc-pvr"
PKG_VERSION="84817e6" PKG_VERSION="a62f4d4"
PKG_REV="1" PKG_REV="1"
PKG_ARCH="any" PKG_ARCH="any"
PKG_LICENSE="GPL" PKG_LICENSE="GPL"

View File

@ -1,255 +0,0 @@
From ee1a1e2c428b5923da9c39f5a78bc9208e4f2047 Mon Sep 17 00:00:00 2001
From: CrystalP <CrystalP@xbmc.org>
Date: Mon, 2 Jan 2012 02:48:24 -0500
Subject: [PATCH] [WIN] fix reporting system memory > 4GB. Need to use
GlobalMemoryEx/MEMORYSTATUSEX instead of GlobalMemory
---
xbmc/GUIInfoManager.cpp | 13 ++++----
xbmc/guilib/TextureBundleXPR.cpp | 9 +++--
xbmc/interfaces/python/xbmcmodule/xbmcmodule.cpp | 7 ++--
xbmc/linux/PlatformDefs.h | 12 ++++----
xbmc/linux/XSyncUtils.cpp | 36 ++++++++++-----------
xbmc/linux/XSyncUtils.h | 2 +-
xbmc/windows/GUIWindowDebugInfo.cpp | 11 ++++---
7 files changed, 46 insertions(+), 44 deletions(-)
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index 0e73d84..1faac26 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -1393,21 +1393,22 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow)
case SYSTEM_USED_MEMORY_PERCENT:
case SYSTEM_TOTAL_MEMORY:
{
- MEMORYSTATUS stat;
- GlobalMemoryStatus(&stat);
- int iMemPercentFree = 100 - ((int)( 100.0f* (stat.dwTotalPhys - stat.dwAvailPhys)/stat.dwTotalPhys + 0.5f ));
+ MEMORYSTATUSEX stat;
+ stat.dwLength = sizeof(MEMORYSTATUSEX);
+ GlobalMemoryStatusEx(&stat);
+ int iMemPercentFree = 100 - ((int)( 100.0f* (stat.ullTotalPhys - stat.ullAvailPhys)/stat.ullTotalPhys + 0.5f ));
int iMemPercentUsed = 100 - iMemPercentFree;
if (info == SYSTEM_FREE_MEMORY)
- strLabel.Format("%luMB", (ULONG)(stat.dwAvailPhys/MB));
+ strLabel.Format("%luMB", (ULONG)(stat.ullAvailPhys/MB));
else if (info == SYSTEM_FREE_MEMORY_PERCENT)
strLabel.Format("%i%%", iMemPercentFree);
else if (info == SYSTEM_USED_MEMORY)
- strLabel.Format("%luMB", (ULONG)((stat.dwTotalPhys - stat.dwAvailPhys)/MB));
+ strLabel.Format("%luMB", (ULONG)((stat.ullTotalPhys - stat.ullAvailPhys)/MB));
else if (info == SYSTEM_USED_MEMORY_PERCENT)
strLabel.Format("%i%%", iMemPercentUsed);
else if (info == SYSTEM_TOTAL_MEMORY)
- strLabel.Format("%luMB", (ULONG)(stat.dwTotalPhys/MB));
+ strLabel.Format("%luMB", (ULONG)(stat.ullTotalPhys/MB));
}
break;
case SYSTEM_SCREEN_MODE:
diff --git a/xbmc/guilib/TextureBundleXPR.cpp b/xbmc/guilib/TextureBundleXPR.cpp
index d6df822..037b4c6 100644
--- a/xbmc/guilib/TextureBundleXPR.cpp
+++ b/xbmc/guilib/TextureBundleXPR.cpp
@@ -279,10 +279,11 @@ bool CTextureBundleXPR::LoadFile(const CStdString& Filename, CAutoTexBuffer& Unp
if (!buffer || !UnpackedBuf.Set((BYTE*)XPhysicalAlloc(file->second.UnpackedSize, MAXULONG_PTR, 128, PAGE_READWRITE)))
{ // failed due to lack of memory
#ifndef _LINUX
- MEMORYSTATUS stat;
- GlobalMemoryStatus(&stat);
- CLog::Log(LOGERROR, "Out of memory loading texture: %s (need %lu bytes, have %lu bytes)", name.c_str(),
- file->second.UnpackedSize + file->second.PackedSize, stat.dwAvailPhys);
+ MEMORYSTATUSEX stat;
+ stat.dwLength = sizeof(MEMORYSTATUSEX);
+ GlobalMemoryStatusEx(&stat);
+ CLog::Log(LOGERROR, "Out of memory loading texture: %s (need %lu bytes, have %"PRIu64" bytes)", name.c_str(),
+ file->second.UnpackedSize + file->second.PackedSize, stat.ullAvailPhys);
#elif defined(__APPLE__) || defined(__FreeBSD__)
CLog::Log(LOGERROR, "Out of memory loading texture: %s (need %d bytes)", name.c_str(),
file->second.UnpackedSize + file->second.PackedSize);
diff --git a/xbmc/interfaces/python/xbmcmodule/xbmcmodule.cpp b/xbmc/interfaces/python/xbmcmodule/xbmcmodule.cpp
index 22ebe2e..910b0cc 100644
--- a/xbmc/interfaces/python/xbmcmodule/xbmcmodule.cpp
+++ b/xbmc/interfaces/python/xbmcmodule/xbmcmodule.cpp
@@ -434,9 +434,10 @@
PyObject* XBMC_GetFreeMem(PyObject *self, PyObject *args)
{
- MEMORYSTATUS stat;
- GlobalMemoryStatus(&stat);
- return PyInt_FromLong( stat.dwAvailPhys / ( 1024 * 1024 ) );
+ MEMORYSTATUSEX stat;
+ stat.dwLength = sizeof(MEMORYSTATUSEX);
+ GlobalMemoryStatusEx(&stat);
+ return PyInt_FromLong( stat.ullAvailPhys / ( 1024 * 1024 ) );
}
// getCpuTemp() method
diff --git a/xbmc/linux/PlatformDefs.h b/xbmc/linux/PlatformDefs.h
index 8910bbc..aaed576 100644
--- a/xbmc/linux/PlatformDefs.h
+++ b/xbmc/linux/PlatformDefs.h
@@ -423,18 +423,18 @@ struct _stati64 {
#define _stat stat
// Memory
-typedef struct _MEMORYSTATUS
+typedef struct _MEMORYSTATUSEX
{
DWORD dwLength;
DWORD dwMemoryLoad;
uint64_t dwTotalPhys;
uint64_t dwAvailPhys;
- uint64_t dwTotalPageFile;
- uint64_t dwAvailPageFile;
- uint64_t dwTotalVirtual;
- uint64_t dwAvailVirtual;
-} MEMORYSTATUS, *LPMEMORYSTATUS;
+ uint64_t ullTotalPageFile;
+ uint64_t ullAvailPageFile;
+ uint64_t ullTotalVirtual;
+ uint64_t ullAvailVirtual;
+} MEMORYSTATUSEX, *LPMEMORYSTATUSEX;
// Common HRESULT values
#ifndef NOERROR
diff --git a/xbmc/linux/XSyncUtils.cpp b/xbmc/linux/XSyncUtils.cpp
index 454ff85..19c4b5a 100644
--- a/xbmc/linux/XSyncUtils.cpp
+++ b/xbmc/linux/XSyncUtils.cpp
@@ -47,13 +47,12 @@
static FILE* procMeminfoFP = NULL;
#endif
-void GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
+void GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer)
{
if (!lpBuffer)
return;
- memset(lpBuffer, 0, sizeof(MEMORYSTATUS));
- lpBuffer->dwLength = sizeof(MEMORYSTATUS);
+ memset(lpBuffer, 0, sizeof(MEMORYSTATUSEX));
#ifdef __APPLE__
uint64_t physmem;
@@ -63,7 +62,7 @@ void GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
// Total physical memory.
if (sysctl(mib, miblen, &physmem, &len, NULL, 0) == 0 && len == sizeof (physmem))
- lpBuffer->dwTotalPhys = physmem;
+ lpBuffer->ullTotalPhys = physmem;
// Virtual memory.
mib[0] = CTL_VM; mib[1] = VM_SWAPUSAGE;
@@ -71,8 +70,8 @@ void GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
len = sizeof(struct xsw_usage);
if (sysctl(mib, miblen, &swap, &len, NULL, 0) == 0)
{
- lpBuffer->dwAvailPageFile = swap.xsu_avail;
- lpBuffer->dwTotalVirtual = lpBuffer->dwTotalPhys + swap.xsu_total;
+ lpBuffer->ullAvailPageFile = swap.xsu_avail;
+ lpBuffer->ullTotalVirtual = lpBuffer->ullTotalPhys + swap.xsu_total;
}
// In use.
@@ -89,8 +88,8 @@ void GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
{
uint64_t used = (vm_stat.active_count + vm_stat.inactive_count + vm_stat.wire_count) * pageSize;
- lpBuffer->dwAvailPhys = lpBuffer->dwTotalPhys - used;
- lpBuffer->dwAvailVirtual = lpBuffer->dwAvailPhys; // FIXME.
+ lpBuffer->ullAvailPhys = lpBuffer->ullTotalPhys - used;
+ lpBuffer->ullAvailVirtual = lpBuffer->ullAvailPhys; // FIXME.
}
}
#elif defined(__FreeBSD__)
@@ -101,8 +100,8 @@ void GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
/* physmem */
len = sizeof(physmem);
if (sysctlbyname("hw.physmem", &physmem, &len, NULL, 0) == 0) {
- lpBuffer->dwTotalPhys = physmem;
- lpBuffer->dwTotalVirtual = physmem;
+ lpBuffer->ullTotalPhys = physmem;
+ lpBuffer->ullTotalVirtual = physmem;
}
/* pagesize */
len = sizeof(pagesize);
@@ -122,11 +121,11 @@ void GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
mem_free *= pagesize;
/* mem_avail = mem_inactive + mem_cache + mem_free */
- lpBuffer->dwAvailPhys = mem_inactive + mem_cache + mem_free;
- lpBuffer->dwAvailVirtual = mem_inactive + mem_cache + mem_free;
+ lpBuffer->ullAvailPhys = mem_inactive + mem_cache + mem_free;
+ lpBuffer->ullAvailVirtual = mem_inactive + mem_cache + mem_free;
if (sysctlbyname("vm.stats.vm.v_swappgsout", &swap_free, &len, NULL, 0) == 0)
- lpBuffer->dwAvailPageFile = swap_free * pagesize;
+ lpBuffer->ullAvailPageFile = swap_free * pagesize;
#else
struct sysinfo info;
char name[32];
@@ -159,12 +158,11 @@ void GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
rewind(procMeminfoFP);
fflush(procMeminfoFP);
}
- lpBuffer->dwLength = sizeof(MEMORYSTATUS);
- lpBuffer->dwAvailPageFile = (info.freeswap * info.mem_unit);
- lpBuffer->dwAvailPhys = ((info.freeram + info.bufferram) * info.mem_unit);
- lpBuffer->dwAvailVirtual = ((info.freeram + info.bufferram) * info.mem_unit);
- lpBuffer->dwTotalPhys = (info.totalram * info.mem_unit);
- lpBuffer->dwTotalVirtual = (info.totalram * info.mem_unit);
+ lpBuffer->ullAvailPageFile = (info.freeswap * info.mem_unit);
+ lpBuffer->ullAvailPhys = ((info.freeram + info.bufferram) * info.mem_unit);
+ lpBuffer->ullAvailVirtual = ((info.freeram + info.bufferram) * info.mem_unit);
+ lpBuffer->ullTotalPhys = (info.totalram * info.mem_unit);
+ lpBuffer->ullTotalVirtual = (info.totalram * info.mem_unit);
#endif
}
diff --git a/xbmc/linux/XSyncUtils.h b/xbmc/linux/XSyncUtils.h
index c8effa2..f3ad36f 100644
--- a/xbmc/linux/XSyncUtils.h
+++ b/xbmc/linux/XSyncUtils.h
@@ -36,7 +36,7 @@
#define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0 ) + 0 )
#define WAIT_ABANDONED_0 ((STATUS_ABANDONED_WAIT_0 ) + 0 )
-void GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer);
+void GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer);
#endif
diff --git a/xbmc/windows/GUIWindowDebugInfo.cpp b/xbmc/windows/GUIWindowDebugInfo.cpp
index 1b2bafa..916b032 100644
--- a/xbmc/windows/GUIWindowDebugInfo.cpp
+++ b/xbmc/windows/GUIWindowDebugInfo.cpp
@@ -97,17 +97,18 @@ void CGUIWindowDebugInfo::Process(unsigned int currentTime, CDirtyRegionList &di
CStdString info;
if (LOG_LEVEL_DEBUG_FREEMEM <= g_advancedSettings.m_logLevel)
{
- MEMORYSTATUS stat;
- GlobalMemoryStatus(&stat);
+ MEMORYSTATUSEX stat;
+ stat.dwLength = sizeof(MEMORYSTATUSEX);
+ GlobalMemoryStatusEx(&stat);
CStdString profiling = CGUIControlProfiler::IsRunning() ? " (profiling)" : "";
CStdString strCores = g_cpuInfo.GetCoresUsageString();
#if !defined(_LINUX)
- info.Format("LOG: %sxbmc.log\nMEM: %d/%d KB - FPS: %2.1f fps\nCPU: %s%s", g_settings.m_logFolder.c_str(),
- stat.dwAvailPhys/1024, stat.dwTotalPhys/1024, g_infoManager.GetFPS(), strCores.c_str(), profiling.c_str());
+ info.Format("LOG: %sxbmc.log\nMEM: %"PRIu64"/%"PRIu64" KB - FPS: %2.1f fps\nCPU: %s%s", g_settings.m_logFolder.c_str(),
+ stat.ullAvailPhys/1024, stat.ullTotalPhys/1024, g_infoManager.GetFPS(), strCores.c_str(), profiling.c_str());
#else
double dCPU = m_resourceCounter.GetCPUUsage();
info.Format("LOG: %sxbmc.log\nMEM: %"PRIu64"/%"PRIu64" KB - FPS: %2.1f fps\nCPU: %s (CPU-XBMC %4.2f%%%s)", g_settings.m_logFolder.c_str(),
- stat.dwAvailPhys/1024, stat.dwTotalPhys/1024, g_infoManager.GetFPS(), strCores.c_str(), dCPU, profiling.c_str());
+ stat.ullAvailPhys/1024, stat.ullTotalPhys/1024, g_infoManager.GetFPS(), strCores.c_str(), dCPU, profiling.c_str());
#endif
}
--
1.7.5.4

View File

@ -1,27 +0,0 @@
From 2f91d0ca3735ab9b1abbfe6e3c6613e56951b7d2 Mon Sep 17 00:00:00 2001
From: wsoltys <wiso@xbmc.org>
Date: Mon, 2 Jan 2012 11:13:02 +0100
Subject: [PATCH] fixed: Linux compiler error (hopefully)
---
xbmc/linux/PlatformDefs.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/xbmc/linux/PlatformDefs.h b/xbmc/linux/PlatformDefs.h
index aaed576..33d1c96 100644
--- a/xbmc/linux/PlatformDefs.h
+++ b/xbmc/linux/PlatformDefs.h
@@ -428,8 +428,8 @@ struct _stati64 {
DWORD dwLength;
DWORD dwMemoryLoad;
- uint64_t dwTotalPhys;
- uint64_t dwAvailPhys;
+ uint64_t ullTotalPhys;
+ uint64_t ullAvailPhys;
uint64_t ullTotalPageFile;
uint64_t ullAvailPageFile;
uint64_t ullTotalVirtual;
--
1.7.5.4

View File

@ -1,30 +0,0 @@
From 32df6ef9fc30cd2215e2a0886ceb5dab368ee31a Mon Sep 17 00:00:00 2001
From: arnova <nospam@void.org>
Date: Mon, 2 Jan 2012 11:41:02 +0100
Subject: [PATCH] fixed: Linux compiler error (again)
---
xbmc/GUIInfoManager.cpp | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index 1faac26..0102008 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -1708,9 +1708,10 @@ bool CGUIInfoManager::GetInt(int &value, int info, int contextWindow, const CGUI
case SYSTEM_FREE_MEMORY:
case SYSTEM_USED_MEMORY:
{
- MEMORYSTATUS stat;
- GlobalMemoryStatus(&stat);
- int memPercentUsed = (int)( 100.0f* (stat.dwTotalPhys - stat.dwAvailPhys)/stat.dwTotalPhys + 0.5f );
+ MEMORYSTATUSEX stat;
+ stat.dwLength = sizeof(MEMORYSTATUSEX);
+ GlobalMemoryStatusEx(&stat);
+ int memPercentUsed = (int)( 100.0f* (stat.ullTotalPhys - stat.ullAvailPhys)/stat.ullTotalPhys + 0.5f );
if (info == SYSTEM_FREE_MEMORY)
value = 100 - memPercentUsed;
else
--
1.7.5.4

View File

@ -1,40 +0,0 @@
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
index d4892b5..697431c 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
@@ -943,6 +943,7 @@ bool CVDPAU::ConfigVDPAU(AVCodecContext* avctx, int ref_frames)
m_vdpauOutputMethod = OUTPUT_NONE;
+ m_binterlacedFrame = false;
return true;
}
@@ -1203,8 +1204,14 @@ int CVDPAU::Decode(AVCodecContext *avctx, AVFrame *pFrame)
m_DVDVideoPics.pop();
}
+ if (!m_binterlacedFrame && m_DVDVideoPics.front().iFlags & DVP_FLAG_INTERLACED)
+ {
+ m_binterlacedFrame = m_DVDVideoPics.front().iFlags & DVP_FLAG_INTERLACED;
+ CLog::Log(LOGNOTICE, "CVDPAU::ConfigOutputMethod: detected interlaced frame");
+ }
+
if (mode == VS_DEINTERLACEMODE_FORCE
- || (mode == VS_DEINTERLACEMODE_AUTO && m_DVDVideoPics.front().iFlags & DVP_FLAG_INTERLACED))
+ || (mode == VS_DEINTERLACEMODE_AUTO && m_binterlacedFrame))
{
if((method == VS_INTERLACEMETHOD_AUTO_ION
|| method == VS_INTERLACEMETHOD_VDPAU_BOB
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h
index 2056de1..fc1b9d0 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h
@@ -209,6 +209,7 @@ public:
uint32_t max_references;
Display* m_Display;
bool vdpauConfigured;
+ bool m_binterlacedFrame;
VdpVideoMixerPictureStructure m_mixerfield;

View File

@ -1,103 +0,0 @@
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 36eb715..c776f65 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -4322,7 +4322,7 @@ void CApplication::CheckScreenSaverAndDPMS()
WakeUpScreenSaver();
}
else if (maybeScreensaver
- && elapsed > g_guiSettings.GetInt("screensaver.time") * 60)
+ && elapsed > g_guiSettings.GetInt("screensaver.time") * 10)
{
ActivateScreenSaver();
}
diff --git a/xbmc/filesystem/DirectoryCache.cpp b/xbmc/filesystem/DirectoryCache.cpp
index e3fb399..84bc32e 100644
--- a/xbmc/filesystem/DirectoryCache.cpp
+++ b/xbmc/filesystem/DirectoryCache.cpp
@@ -67,7 +67,7 @@ bool CDirectoryCache::GetDirectory(const CStdString& strPath, CFileItemList &ite
{
CSingleLock lock (m_cs);
- CStdString storedPath = strPath;
+ CStdString storedPath = URIUtils::SubstitutePath(strPath);
URIUtils::RemoveSlashAtEnd(storedPath);
ciCache i = m_cache.find(storedPath);
@@ -106,7 +106,7 @@ void CDirectoryCache::SetDirectory(const CStdString& strPath, const CFileItemLis
// this is the best solution for now.
CSingleLock lock (m_cs);
- CStdString storedPath = strPath;
+ CStdString storedPath = URIUtils::SubstitutePath(strPath);
URIUtils::RemoveSlashAtEnd(storedPath);
ClearDirectory(storedPath);
@@ -130,7 +130,7 @@ void CDirectoryCache::ClearDirectory(const CStdString& strPath)
{
CSingleLock lock (m_cs);
- CStdString storedPath = strPath;
+ CStdString storedPath = URIUtils::SubstitutePath(strPath);
URIUtils::RemoveSlashAtEnd(storedPath);
iCache i = m_cache.find(storedPath);
@@ -142,7 +142,7 @@ void CDirectoryCache::ClearSubPaths(const CStdString& strPath)
{
CSingleLock lock (m_cs);
- CStdString storedPath = strPath;
+ CStdString storedPath = URIUtils::SubstitutePath(strPath);
URIUtils::RemoveSlashAtEnd(storedPath);
iCache i = m_cache.begin();
diff --git a/xbmc/filesystem/File.cpp b/xbmc/filesystem/File.cpp
index 415f2bf..375226e 100644
--- a/xbmc/filesystem/File.cpp
+++ b/xbmc/filesystem/File.cpp
@@ -217,16 +217,15 @@ bool CFile::Open(const CStdString& strFileName, unsigned int flags)
try
{
bool bPathInCache;
- CURL url2(strFileName);
- if (url2.GetProtocol() == "zip")
- url2.SetOptions("");
- if (!g_directoryCache.FileExists(url2.Get(), bPathInCache) )
+ CURL url(URIUtils::SubstitutePath(strFileName));
+ if (url.GetProtocol() == "zip")
+ url.SetOptions("");
+ if (!g_directoryCache.FileExists(url.Get(), bPathInCache) )
{
if (bPathInCache)
return false;
}
- CURL url(URIUtils::SubstitutePath(strFileName));
if ( (flags & READ_NO_CACHE) == 0 && URIUtils::IsInternetStream(url) && !CUtil::IsPicture(strFileName) )
m_flags |= READ_CACHED;
@@ -344,7 +343,7 @@ bool CFile::OpenForWrite(const CStdString& strFileName, bool bOverWrite)
bool CFile::Exists(const CStdString& strFileName, bool bUseCache /* = true */)
{
- CURL url;
+ CURL url(URIUtils::SubstitutePath(strFileName));
try
{
@@ -354,14 +353,12 @@ bool CFile::Exists(const CStdString& strFileName, bool bUseCache /* = true */)
if (bUseCache)
{
bool bPathInCache;
- if (g_directoryCache.FileExists(strFileName, bPathInCache) )
+ if (g_directoryCache.FileExists(url.Get(), bPathInCache) )
return true;
if (bPathInCache)
return false;
}
- url = URIUtils::SubstitutePath(strFileName);
-
auto_ptr<IFile> pFile(CFileFactory::CreateLoader(url));
if (!pFile.get())
return false;

View File

@ -1,29 +0,0 @@
From 067004b0301366cb4bafc22dff21ec396e044bb7 Mon Sep 17 00:00:00 2001
From: arnova <arnova@void.org>
Date: Wed, 21 Dec 2011 13:59:13 +0100
Subject: [PATCH] [SDL] fixed: Crash when mixer fails to initialise
---
xbmc/guilib/GUIAudioManager.cpp | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/xbmc/guilib/GUIAudioManager.cpp b/xbmc/guilib/GUIAudioManager.cpp
index 83f4e40..db58426 100644
--- a/xbmc/guilib/GUIAudioManager.cpp
+++ b/xbmc/guilib/GUIAudioManager.cpp
@@ -73,8 +73,10 @@ void CGUIAudioManager::Initialize(int iDevice)
#elif defined(HAS_SDL_AUDIO)
Mix_CloseAudio();
if (Mix_OpenAudio(44100, AUDIO_S16, 2, 4096))
- CLog::Log(LOGERROR, "Unable to open audio mixer");
- Mix_Volume(0, (int)(128.f * (g_settings.m_nVolumeLevel - VOLUME_MINIMUM) / (float)(VOLUME_MAXIMUM - VOLUME_MINIMUM)));
+ CLog::Log(LOGERROR, "Unable to open audio mixer");
+ else
+ Mix_Volume(0, (int)(128.f * (g_settings.m_nVolumeLevel - VOLUME_MINIMUM) / (float)(VOLUME_MAXIMUM - VOLUME_MINIMUM)));
+
m_bInitialized = true;
#endif
}
--
1.7.5.4

View File

@ -1,69 +0,0 @@
diff --git a/xbmc/filesystem/DllLibCurl.cpp b/xbmc/filesystem/DllLibCurl.cpp
index f93e693..65ecad8 100644
--- a/xbmc/filesystem/DllLibCurl.cpp
+++ b/xbmc/filesystem/DllLibCurl.cpp
@@ -39,7 +39,7 @@ bool DllLibCurlGlobal::Load()
CSingleLock lock(m_critSection);
if(g_curlReferences > 0)
{
- g_curlReferences++;
+ //g_curlReferences++;
return true;
}
@@ -56,13 +56,16 @@ bool DllLibCurlGlobal::Load()
}
/* check idle will clean up the last one */
- g_curlReferences = 2;
+ //g_curlReferences = 2;
+ g_curlReferences = 1;
return true;
}
void DllLibCurlGlobal::Unload()
{
+ return;
+ /*
CSingleLock lock(m_critSection);
if (--g_curlReferences == 0)
{
@@ -75,19 +78,22 @@ void DllLibCurlGlobal::Unload()
DllDynamic::Unload();
}
- /* CheckIdle will clear this one up */
+ // CheckIdle will clear this one up
if(g_curlReferences == 1)
g_curlTimeout = XbmcThreads::SystemClockMillis();
+ */
}
void DllLibCurlGlobal::CheckIdle()
{
/* avoid locking section here, to avoid stalling gfx thread on loads*/
+ return;
+ /*
if(g_curlReferences == 0)
return;
CSingleLock lock(m_critSection);
- /* 20 seconds idle time before closing handle */
+ // 20 seconds idle time before closing handle
const unsigned int idletime = 30000;
VEC_CURLSESSIONS::iterator it = m_sessions.begin();
@@ -112,9 +118,10 @@ void DllLibCurlGlobal::CheckIdle()
it++;
}
- /* check if we should unload the dll */
+ // check if we should unload the dll
if(g_curlReferences == 1 && XbmcThreads::SystemClockMillis() - g_curlTimeout > idletime)
Unload();
+ */
}
void DllLibCurlGlobal::easy_aquire(const char *protocol, const char *hostname, CURL_HANDLE** easy_handle, CURLM** multi_handle)

View File

@ -1,63 +0,0 @@
From 505b702af7025ad977558e75d25764744c47f5a3 Mon Sep 17 00:00:00 2001
From: vdrfan <vdrfan-nospam-@xbmc.org>
Date: Wed, 28 Dec 2011 00:31:07 +0100
Subject: [PATCH] fixed: reverted File.cpp parts of
23607e247c0074d88464a39eca643897550cb70 as they were
causing troubles
---
xbmc/filesystem/File.cpp | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/xbmc/filesystem/File.cpp b/xbmc/filesystem/File.cpp
index 375226e..ef16255 100644
--- a/xbmc/filesystem/File.cpp
+++ b/xbmc/filesystem/File.cpp
@@ -217,15 +217,16 @@ bool CFile::Open(const CStdString& strFileName, unsigned int flags)
try
{
bool bPathInCache;
- CURL url(URIUtils::SubstitutePath(strFileName));
- if (url.GetProtocol() == "zip")
- url.SetOptions("");
- if (!g_directoryCache.FileExists(url.Get(), bPathInCache) )
+ CURL url2(strFileName);
+ if (url2.GetProtocol() == "zip")
+ url2.SetOptions("");
+ if (!g_directoryCache.FileExists(url2.Get(), bPathInCache) )
{
if (bPathInCache)
return false;
}
+ CURL url(URIUtils::SubstitutePath(strFileName));
if ( (flags & READ_NO_CACHE) == 0 && URIUtils::IsInternetStream(url) && !CUtil::IsPicture(strFileName) )
m_flags |= READ_CACHED;
@@ -343,7 +344,7 @@ bool CFile::OpenForWrite(const CStdString& strFileName, bool bOverWrite)
bool CFile::Exists(const CStdString& strFileName, bool bUseCache /* = true */)
{
- CURL url(URIUtils::SubstitutePath(strFileName));
+ CURL url;
try
{
@@ -353,12 +354,13 @@ bool CFile::Exists(const CStdString& strFileName, bool bUseCache /* = true */)
if (bUseCache)
{
bool bPathInCache;
- if (g_directoryCache.FileExists(url.Get(), bPathInCache) )
+ if (g_directoryCache.FileExists(strFileName, bPathInCache) )
return true;
if (bPathInCache)
return false;
}
+ url = URIUtils::SubstitutePath(strFileName);
auto_ptr<IFile> pFile(CFileFactory::CreateLoader(url));
if (!pFile.get())
return false;
--
1.7.5.4

View File

@ -1,121 +0,0 @@
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

@ -1,228 +0,0 @@
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

@ -1,124 +0,0 @@
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

@ -1,25 +0,0 @@
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

@ -1,72 +0,0 @@
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

@ -1,28 +0,0 @@
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

@ -1,20 +0,0 @@
commit bee67c6b7129a6764c964a93e35e33b7cf2b35ea
Author: spiff <spiff@xbmc.org>
Date: Wed Jan 18 16:33:47 2012 +0100
fixed: don't deref null pointers, not even in release builds
diff --git a/xbmc/addons/AddonInstaller.cpp b/xbmc/addons/AddonInstaller.cpp
index dc5c366..a7d96c0 100644
--- a/xbmc/addons/AddonInstaller.cpp
+++ b/xbmc/addons/AddonInstaller.cpp
@@ -262,6 +262,9 @@ void CAddonInstaller::InstallFromXBMCRepo(const set<CStdString> &addonIDs)
bool CAddonInstaller::CheckDependencies(const AddonPtr &addon)
{
assert(addon.get());
+ if (!addon)
+ return false;
+
ADDONDEPS deps = addon->GetDeps();
CAddonDatabase database;
database.Open();

View File

@ -1,54 +0,0 @@
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

@ -1,124 +0,0 @@
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

@ -1,29 +0,0 @@
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

View File

@ -1,38 +0,0 @@
From 994a4cb70a9437105ef9c176d5d79939382d22e8 Mon Sep 17 00:00:00 2001
From: Gregor Fuis <gregor.fuis@gmail.com>
Date: Mon, 2 Jan 2012 17:13:54 +0100
Subject: [PATCH] tvheadend pvr client: retry connecting within timout
---
xbmc/pvrclients/tvheadend/HTSPConnection.cpp | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/xbmc/pvrclients/tvheadend/HTSPConnection.cpp b/xbmc/pvrclients/tvheadend/HTSPConnection.cpp
index 5f5865d..4adb45b 100644
--- a/xbmc/pvrclients/tvheadend/HTSPConnection.cpp
+++ b/xbmc/pvrclients/tvheadend/HTSPConnection.cpp
@@ -57,12 +57,20 @@ bool CHTSPConnection::Connect()
if (m_bIsConnected)
return true;
+ cTimeMs RetryTimeout;
char errbuf[1024];
int errlen = sizeof(errbuf);
XBMC->Log(LOG_DEBUG, "%s - connecting to '%s', port '%d'", __FUNCTION__, m_strHostname.c_str(), m_iPortnumber);
- m_fd = tcp_connect(m_strHostname.c_str(), m_iPortnumber, errbuf, errlen, m_iConnectTimeout);
+ m_fd = INVALID_SOCKET;
+ while (m_fd == INVALID_SOCKET && RetryTimeout.Elapsed() < (uint)m_iConnectTimeout * 1000)
+ {
+ m_fd = tcp_connect(m_strHostname.c_str(), m_iPortnumber, errbuf, errlen,
+ m_iConnectTimeout * 1000 - RetryTimeout.Elapsed());
+ cCondWait::SleepMs(100);
+ }
+
if(m_fd == INVALID_SOCKET)
{
XBMC->Log(LOG_ERROR, "%s - failed to connect to the backend (%s)", __FUNCTION__, errbuf);
--
1.7.5.4

View File

@ -1,30 +0,0 @@
From 949162c47809bb7e9ae2e2b24aad7776a737ecc4 Mon Sep 17 00:00:00 2001
From: Lars Op den Kamp <lars@opdenkamp.eu>
Date: Tue, 3 Jan 2012 02:09:37 +0100
Subject: [PATCH] pvr: remove deleted channels from the internal group too.
closes #366
---
xbmc/pvr/channels/PVRChannelGroup.cpp | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/xbmc/pvr/channels/PVRChannelGroup.cpp b/xbmc/pvr/channels/PVRChannelGroup.cpp
index 9748fb0..0f74527 100644
--- a/xbmc/pvr/channels/PVRChannelGroup.cpp
+++ b/xbmc/pvr/channels/PVRChannelGroup.cpp
@@ -608,11 +608,8 @@ bool CPVRChannelGroup::RemoveDeletedChannels(const CPVRChannelGroup &channels)
/* since it was not found in the internal group, it was deleted from the backend */
channel->Delete();
}
- else
- {
- erase(begin() + iChannelPtr);
- }
+ erase(begin() + iChannelPtr);
m_bChanged = true;
bReturn = true;
}
--
1.7.5.4

View File

@ -1,165 +0,0 @@
From 3daa7b4ea1ef04a347d660f4c696beaaeb30a83e Mon Sep 17 00:00:00 2001
From: xbmc <fernetmenta@online.de>
Date: Fri, 6 Jan 2012 16:07:30 +0100
Subject: [PATCH] vdpau: fix segfault on recovery
---
xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 74 +++++++++++++++---------
1 files changed, 46 insertions(+), 28 deletions(-)
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
index 823686c..efd05de 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
@@ -207,6 +207,16 @@ void CVDPAU::Close()
FiniVDPAUOutput();
FiniVDPAUProcs();
+ while (!m_videoSurfaces.empty())
+ {
+ vdpau_render_state *render = m_videoSurfaces.back();
+ m_videoSurfaces.pop_back();
+ if (render->bitstream_buffers_allocated)
+ m_dllAvUtil.av_freep(&render->bitstream_buffers);
+ render->bitstream_buffers_allocated = 0;
+ free(render);
+ }
+
g_Windowing.Unregister(this);
m_dllAvUtil.Unload();
}
@@ -698,10 +708,13 @@ void CVDPAU::InitVDPAUProcs()
VdpStatus vdp_st;
// Create Device
+ // tested on 64bit Ubuntu 11.10 and it deadlocked without this
+ XLockDisplay(m_Display);
vdp_st = dl_vdp_device_create_x11(m_Display, //x_display,
mScreen, //x_screen,
&vdp_device,
&vdp_get_proc_address);
+ XUnlockDisplay(m_Display);
CLog::Log(LOGNOTICE,"vdp_device = 0x%08x vdp_st = 0x%08x",vdp_device,vdp_st);
if (vdp_st != VDP_STATUS_OK)
@@ -779,16 +792,6 @@ void CVDPAU::InitVDPAUProcs()
void CVDPAU::FiniVDPAUProcs()
{
- while (!m_videoSurfaces.empty())
- {
- vdpau_render_state *render = m_videoSurfaces.back();
- m_videoSurfaces.pop_back();
- if (render->bitstream_buffers_allocated)
- m_dllAvUtil.av_freep(&render->bitstream_buffers);
- render->bitstream_buffers_allocated = 0;
- free(render);
- }
-
if (vdp_device == VDP_INVALID_HANDLE) return;
VdpStatus vdp_st;
@@ -827,16 +830,14 @@ void CVDPAU::FiniVDPAUOutput()
return;
decoder = VDP_INVALID_HANDLE;
- while (!m_videoSurfaces.empty())
+ for (unsigned int i = 0; i < m_videoSurfaces.size(); ++i)
{
- vdpau_render_state *render = m_videoSurfaces.back();
- m_videoSurfaces.pop_back();
- if (render->bitstream_buffers_allocated)
- m_dllAvUtil.av_freep(&render->bitstream_buffers);
- render->bitstream_buffers_allocated = 0;
- vdp_st = vdp_video_surface_destroy(render->surface);
- render->surface = VDP_INVALID_HANDLE;
- free(render);
+ vdpau_render_state *render = m_videoSurfaces[i];
+ if (render->surface != VDP_INVALID_HANDLE)
+ {
+ vdp_st = vdp_video_surface_destroy(render->surface);
+ render->surface = VDP_INVALID_HANDLE;
+ }
if (CheckStatus(vdp_st, __LINE__))
return;
}
@@ -999,14 +1000,14 @@ bool CVDPAU::FiniOutputMethod()
{
CLog::Log(LOGDEBUG, "GLX: Destroying glPixmap");
glXDestroyPixmap(m_Display, m_glPixmap);
- m_glPixmap = NULL;
+ m_glPixmap = None;
}
if (m_Pixmap)
{
CLog::Log(LOGDEBUG, "GLX: Destroying XPixmap");
XFreePixmap(m_Display, m_Pixmap);
- m_Pixmap = NULL;
+ m_Pixmap = None;
}
outputSurface = presentSurface = VDP_INVALID_HANDLE;
@@ -1086,7 +1087,8 @@ bool CVDPAU::IsSurfaceValid(vdpau_render_state *render)
{
// find render state in queue
bool found(false);
- for(unsigned int i = 0; i < m_videoSurfaces.size(); ++i)
+ unsigned int i;
+ for(i = 0; i < m_videoSurfaces.size(); ++i)
{
if(m_videoSurfaces[i] == render)
{
@@ -1094,7 +1096,18 @@ bool CVDPAU::IsSurfaceValid(vdpau_render_state *render)
break;
}
}
- return found;
+ if (!found)
+ {
+ CLog::Log(LOGERROR,"%s - video surface not found", __FUNCTION__);
+ return false;
+ }
+ if (m_videoSurfaces[i]->surface == VDP_INVALID_HANDLE)
+ {
+ m_videoSurfaces[i]->state = 0;
+ return false;
+ }
+
+ return true;
}
int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic)
@@ -1140,11 +1153,17 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic)
CLog::Log(LOGWARNING, "CVDPAU::FFGetBuffer - calloc failed");
return -1;
}
+ render->surface = VDP_INVALID_HANDLE;
+ vdp->m_videoSurfaces.push_back(render);
+ }
+
+ if (render->surface == VDP_INVALID_HANDLE)
+ {
vdp_st = vdp->vdp_video_surface_create(vdp->vdp_device,
- vdp->vdp_chroma_type,
- avctx->coded_width,
- avctx->coded_height,
- &render->surface);
+ vdp->vdp_chroma_type,
+ avctx->coded_width,
+ avctx->coded_height,
+ &render->surface);
vdp->CheckStatus(vdp_st, __LINE__);
if (vdp_st != VDP_STATUS_OK)
{
@@ -1152,7 +1171,6 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic)
CLog::Log(LOGERROR, "CVDPAU::FFGetBuffer - No Video surface available could be created");
return -1;
}
- vdp->m_videoSurfaces.push_back(render);
}
if (render == NULL)
--
1.7.5.4

View File

@ -1,121 +0,0 @@
From ac6a16ff11ba6087cba773938c34558a4bce4837 Mon Sep 17 00:00:00 2001
From: Jonathan Marshall <jmarshall@never.you.mind>
Date: Wed, 18 Jan 2012 11:48:17 +1300
Subject: [PATCH] Fix finding of local thumbs/fanart for VIDEO_TS/BDMV items
in the parent folder
---
xbmc/FileItem.cpp | 45 +++++++++++++++++++++++++++++++--------------
xbmc/FileItem.h | 14 ++++++++++++++
2 files changed, 45 insertions(+), 14 deletions(-)
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp
index 8e2f1df..c21c0f4 100644
--- a/xbmc/FileItem.cpp
+++ b/xbmc/FileItem.cpp
@@ -2112,25 +2112,11 @@ void CFileItemList::StackFolders()
if (!dvdPath.IsEmpty())
{
// NOTE: should this be done for the CD# folders too?
- /* set the thumbnail based on folder */
- item->SetCachedVideoThumb();
- if (!item->HasThumbnail())
- item->SetUserVideoThumb();
-
item->m_bIsFolder = false;
item->SetPath(dvdPath);
item->SetLabel2("");
item->SetLabelPreformated(true);
m_sortMethod = SORT_METHOD_NONE; /* sorting is now broken */
-
- /* override the previously set thumb if video_ts.ifo has any */
- /* otherwise user can't set icon on the stacked file as that */
- /* will allways be set on the video_ts.ifo file */
- CStdString thumb(item->GetCachedVideoThumb());
- if(CFile::Exists(thumb))
- item->SetThumbnailImage(thumb);
- else
- item->SetUserVideoThumb();
}
}
}
@@ -2646,6 +2632,15 @@ CStdString CFileItem::GetUserVideoThumb() const
if (CFile::Exists(fileThumb))
return fileThumb;
+ if (IsOpticalMediaFile())
+ { // special case for optical media "folders" - check the parent folder (or parent of parent)
+ // TODO: A better way to handle this would be to treat stacked folders as folders rather than files.
+ CFileItem item(GetLocalMetadataPath(), true);
+ CStdString thumb(item.GetUserVideoThumb());
+ if (!thumb.IsEmpty())
+ return thumb;
+ }
+
// 2. - check movie.tbn, as long as it's not a folder
if (!m_bIsFolder)
{
@@ -2886,6 +2881,12 @@ CStdString CFileItem::GetLocalFanart() const
CFileItemList items;
CDirectory::GetDirectory(strDir, items, g_settings.m_pictureExtensions, false, false, DIR_CACHE_ALWAYS, false, true);
+ if (IsOpticalMediaFile())
+ { // grab from the optical media parent folder as well - see GetUserVideoThumb
+ CFileItemList moreItems;
+ CDirectory::GetDirectory(GetLocalMetadataPath(), moreItems, g_settings.m_pictureExtensions, false, false, DIR_CACHE_ALWAYS, false, true);
+ items.Append(moreItems);
+ }
CStdStringArray fanarts;
StringUtils::SplitString(g_advancedSettings.m_fanartImages, "|", fanarts);
@@ -2912,6 +2913,22 @@ CStdString CFileItem::GetLocalFanart() const
return "";
}
+CStdString CFileItem::GetLocalMetadataPath() const
+{
+ if (m_bIsFolder && !IsFileFolder())
+ return m_strPath;
+
+ CStdString parent(URIUtils::GetParentPath(m_strPath));
+ CStdString parentFolder(parent);
+ URIUtils::RemoveSlashAtEnd(parentFolder);
+ parentFolder = URIUtils::GetFileName(parentFolder);
+ if (parentFolder == "VIDEO_TS" || parentFolder == "BDMV")
+ { // go back up another one
+ parent = URIUtils::GetParentPath(parent);
+ }
+ return parent;
+}
+
CStdString CFileItem::GetCachedFanart() const
{
return CThumbnailCache::GetFanart(*this);
diff --git a/xbmc/FileItem.h b/xbmc/FileItem.h
index d621880..c5a748b 100644
--- a/xbmc/FileItem.h
+++ b/xbmc/FileItem.h
@@ -258,6 +258,20 @@ class CFileItem :
void SetUserVideoThumb();
void SetUserMusicThumb(bool alwaysCheckRemote = false);
+ /*! \brief Get the path where we expect local metadata to reside.
+ For a folder, this is just the existing path (eg tvshow folder)
+ For a file, this is the parent path, with exceptions made for VIDEO_TS and BDMV files
+
+ Three cases are handled:
+
+ /foo/bar/movie_name/file_name -> /foo/bar/movie_name/
+ /foo/bar/movie_name/VIDEO_TS/file_name -> /foo/bar/movie_name/
+ /foo/bar/movie_name/BDMV/file_name -> /foo/bar/movie_name/
+
+ \sa URIUtils::GetParentPath
+ */
+ CStdString GetLocalMetadataPath() const;
+
// finds a matching local trailer file
CStdString FindTrailer() const;
--
1.7.5.4

View File

@ -1,38 +0,0 @@
From fb3128b24683e3b700f10aa3f8e3c58eb0a2c41a Mon Sep 17 00:00:00 2001
From: Jonathan Marshall <jmarshall@never.you.mind>
Date: Thu, 19 Jan 2012 12:18:17 +1300
Subject: [PATCH] fix movie.nfo not being picked up in the movie folder of
bluray or dvd rips
---
xbmc/video/VideoInfoScanner.cpp | 13 +++----------
1 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp
index 4534aa1..5cf75a9 100644
--- a/xbmc/video/VideoInfoScanner.cpp
+++ b/xbmc/video/VideoInfoScanner.cpp
@@ -1445,17 +1445,10 @@
}
}
- if (!nfoFile.IsEmpty() && item->IsOpticalMediaFile())
+ if (nfoFile.IsEmpty() && item->IsOpticalMediaFile())
{
- CStdString parent(URIUtils::GetParentPath(item->GetPath()));
- CStdString parentFolder(parent);
- URIUtils::RemoveSlashAtEnd(parentFolder);
- if (parentFolder == "VIDEO_TS" || parentFolder == "BDMV")
- { // check for movie.nfo in the parent folder
- parent = URIUtils::GetParentPath(parent);
- CFileItem parentDirectory(parent, true);
- nfoFile = GetnfoFile(&parentDirectory, true);
- }
+ CFileItem parentDirectory(item->GetLocalMetadataPath(), true);
+ nfoFile = GetnfoFile(&parentDirectory, true);
}
}
// folders (or stacked dvds) can take any nfo file if there's a unique one
--
1.7.5.4