xbmc: update to xbmc-12.0.2

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue
2013-02-19 21:41:42 +01:00
parent 22c53cb072
commit 6b8f37c527
12 changed files with 3 additions and 1450 deletions

View File

@@ -19,7 +19,7 @@
################################################################################
PKG_NAME="xbmc-theme-Confluence"
PKG_VERSION="12.0.1"
PKG_VERSION="12.0.2"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@@ -19,7 +19,7 @@
################################################################################
PKG_NAME="xbmc"
PKG_VERSION="12.0.1"
PKG_VERSION="12.0.2"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@@ -1,39 +0,0 @@
From ac86e23aa11861a4fa063fb2fa05f10cbc4eea19 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Fri, 1 Feb 2013 18:37:20 +0000
Subject: [PATCH] [rbp] Avoid blocking the video thread keeping the video fifo
full. OpenMAX IL is an asynchronous media player. The key
to getting good performance is to ensure the audio and
video fifo have sufficient data to withstand any processing
spikes by the ARM. Ideally the fifos would allow the arm to
crash, and video and audio playback to continue smoothly
for a couple of seconds.
I've examined the fifo behaviour, and found the video fifo is always almost empty. (The audio fifo is full).
It turns out that the PlayerVideo task (which submits video frames to GPU fifo) blocks until the presentation time has arrived before calling FlipPage (in order to keep subtitles etc. synced).
This is very bad. We generally only one frame of video data in the GPU fifo. This means a spike in ARM workload (e.g. bringing up OSD, or a peak in bitrate) causes the fifo to empty and video to stutter.
The patch here avoids blocking, and lets the FlipPage happen on a later packet.
I've found with this patch, my test clip (1080p with software DTS audio decode) I can play without stuttering at 700MHz. Without this patch it fails to play even at 1000MHz.
---
xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
index 90f94aa..5f3f050 100644
--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
@@ -455,8 +455,8 @@ void OMXPlayerVideo::Output(int iGroupId, double pts, bool bDropPacket)
double pts_media = m_av_clock->OMXMediaTime(false, false);
ProcessOverlays(iGroupId, pts_media);
- while(!CThread::m_bStop && m_av_clock->GetAbsoluteClock(false) < (iCurrentClock + iSleepTime + DVD_MSEC_TO_TIME(500)) )
- Sleep(1);
+ if (!CThread::m_bStop && m_av_clock->GetAbsoluteClock(false) < (iCurrentClock + iSleepTime + DVD_MSEC_TO_TIME(500)) )
+ return;
g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, -1, FS_NONE);
--
1.7.10

View File

@@ -1,26 +0,0 @@
From 5c61cc2c3ef7b047060742d736fd2a8cc037ae57 Mon Sep 17 00:00:00 2001
From: Jim Carroll <thecarrolls@jiminger.com>
Date: Sun, 3 Feb 2013 16:31:51 -0500
Subject: [PATCH] Remove some annoying log-spam.
---
xbmc/interfaces/python/CallbackHandler.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xbmc/interfaces/python/CallbackHandler.cpp b/xbmc/interfaces/python/CallbackHandler.cpp
index 01707b9..61c0b5f 100644
--- a/xbmc/interfaces/python/CallbackHandler.cpp
+++ b/xbmc/interfaces/python/CallbackHandler.cpp
@@ -35,8 +35,8 @@
*/
PythonCallbackHandler::PythonCallbackHandler() : RetardedAsynchCallbackHandler("PythonCallbackHandler")
{
+ TRACE;
objectThreadState = PyThreadState_Get();
- CLog::Log(LOGDEBUG,"NEWADDON PythonCallbackHandler construction with PyThreadState 0x%lx",(long)objectThreadState);
}
/**
--
1.7.10

File diff suppressed because it is too large Load Diff

View File

@@ -1,68 +0,0 @@
From 94ea56fc7c14ade6338e00ff67942ebd7b345e01 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Mon, 11 Feb 2013 11:38:26 +0000
Subject: [PATCH] [rbp] Fix for broken ASS subtitles.
The video fifo patch broke some types of subtitles including ASS.
This keeps closer track of when the sleep time would have ended and calls FlipPage at the appropriate time.
I've also removed the 500ms in the sleep time calculation as that makes the subs render 500ms late. Not sure what its purpose was.
---
xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 19 +++++++++++++++----
xbmc/cores/omxplayer/OMXPlayerVideo.h | 1 +
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
index 4dec28a..ec7e7f6 100644
--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
@@ -124,6 +124,7 @@ bool OMXPlayerVideo::OpenStream(CDVDStreamInfo &hints)
m_started = false;
m_stalled = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET) == 0;
m_autosync = 1;
+ m_iSleepEndTime = DVD_NOPTS_VALUE;
m_audio_count = m_av_clock->HasAudio();
@@ -452,13 +453,23 @@ void OMXPlayerVideo::Output(int iGroupId, double pts, bool bDropPacket)
m_dropbase = 0.0f;
#endif
- double pts_media = m_av_clock->OMXMediaTime(false, false);
- ProcessOverlays(iGroupId, pts_media);
+ // DVDPlayer sleeps until m_iSleepEndTime here before calling FlipPage.
+ // Video playback in asynchronous in OMXPlayer, so we don't want to do that here, as it prevents the video fifo from being kept full.
+ // So, we keep track of when FlipPage would have been called on DVDPlayer and return early if it is not time.
+ // m_iSleepEndTime == DVD_NOPTS_VALUE means we are not waiting to call FlipPage, otherwise it is the time we want to call FlipPage
+ if (m_iSleepEndTime == DVD_NOPTS_VALUE) {
+ m_iSleepEndTime = iCurrentClock + iSleepTime;
+ }
- if (!CThread::m_bStop && m_av_clock->GetAbsoluteClock(false) < (iCurrentClock + iSleepTime + DVD_MSEC_TO_TIME(500)) )
+ if (!CThread::m_bStop && m_av_clock->GetAbsoluteClock(false) < m_iSleepEndTime)
return;
- g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, -1, FS_NONE);
+ m_iSleepEndTime = DVD_NOPTS_VALUE;
+
+ double pts_media = m_av_clock->OMXMediaTime(false, false);
+ ProcessOverlays(iGroupId, pts_media);
+
+ g_renderManager.FlipPage(CThread::m_bStop, pts_media / DVD_TIME_BASE, -1, FS_NONE);
//m_av_clock->WaitAbsoluteClock((iCurrentClock + iSleepTime));
}
diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.h b/xbmc/cores/omxplayer/OMXPlayerVideo.h
index 3fd643e..cf05c1f 100644
--- a/xbmc/cores/omxplayer/OMXPlayerVideo.h
+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.h
@@ -49,6 +49,7 @@ class OMXPlayerVideo : public CThread
bool m_open;
CDVDStreamInfo m_hints;
double m_iCurrentPts;
+ double m_iSleepEndTime;
OMXClock *m_av_clock;
COMXVideo m_omxVideo;
float m_fFrameRate;
--
1.7.10

View File

@@ -1,34 +0,0 @@
From d1196435876904453d49b93ce5cefa6903489162 Mon Sep 17 00:00:00 2001
From: Martijn Kaijser <mcm.kaijser@gmail.com>
Date: Wed, 30 Jan 2013 19:30:47 +0100
Subject: [PATCH] [visualizations] fix crash in goom fixes #12584
---
xbmc/visualizations/Goom/goom2k4-0/src/mmx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xbmc/visualizations/Goom/goom2k4-0/src/mmx.c b/xbmc/visualizations/Goom/goom2k4-0/src/mmx.c
index fdf0649..8effa52 100644
--- a/xbmc/visualizations/Goom/goom2k4-0/src/mmx.c
+++ b/xbmc/visualizations/Goom/goom2k4-0/src/mmx.c
@@ -91,7 +91,7 @@ void zoom_filter_mmx (int prevX, int prevY,
"punpckhbw %%mm7, %%mm5 \n\t" /* 00-c4-00-c4-00-c4-00-c4 */
/* ajouter la longueur de ligne a esi */
- "addl 8(%%ebp),%1 \n\t"
+ "addl %4,%1 \n\t"
/* recuperation des 2 derniers pixels */
"movq (%3,%1,4), %%mm1 \n\t"
@@ -115,7 +115,7 @@ void zoom_filter_mmx (int prevX, int prevY,
"movd %%mm0,%0 \n\t"
:"=g"(expix2[loop])
- :"r"(pos),"r"(coeffs),"r"(expix1)
+ :"r"(pos),"r"(coeffs),"r"(expix1),"r"(prevX)
);
--
1.7.10

View File

@@ -1,58 +0,0 @@
From c1cc1b3dd1065c7a1dea33cf57fbbcae19b38c3b Mon Sep 17 00:00:00 2001
From: Andy Maloney <andy@forident.com>
Date: Sun, 10 Feb 2013 08:31:51 -0500
Subject: [PATCH] Fix memory leaks & Use correct "delete" for arrays
---
xbmc/network/AirTunesServer.cpp | 6 +++++-
xbmc/visualizations/Vortex/VortexVis/Core/Renderer.cpp | 2 +-
xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/xbmc/network/AirTunesServer.cpp b/xbmc/network/AirTunesServer.cpp
index fe3d78d..2f30773 100644
--- a/xbmc/network/AirTunesServer.cpp
+++ b/xbmc/network/AirTunesServer.cpp
@@ -339,8 +339,12 @@ ao_device* CAirTunesServer::AudioOutputFunctions::ao_open_live(int driver_id, ao
header.durationMs = 0;
if (device->pipe->Write(&header, sizeof(header)) == 0)
+ {
+ delete device->pipe;
+ delete device;
return 0;
-
+ }
+
ThreadMessage tMsg = { TMSG_MEDIA_STOP };
CApplicationMessenger::Get().SendMessage(tMsg, true);
diff --git a/xbmc/visualizations/Vortex/VortexVis/Core/Renderer.cpp b/xbmc/visualizations/Vortex/VortexVis/Core/Renderer.cpp
index 2191505..ffd39b9 100644
--- a/xbmc/visualizations/Vortex/VortexVis/Core/Renderer.cpp
+++ b/xbmc/visualizations/Vortex/VortexVis/Core/Renderer.cpp
@@ -1347,7 +1347,7 @@ void Renderer::Sphere(int del_uhol_x, int del_uhol_y, float size)
// g_device->DrawPrimitive(D3DPT_TRIANGLESTRIP, i*2*(del_y+1), 2*del_y );
m_pD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2*del_uhol_y, &v[i*2*(del_uhol_y+1)], sizeof(PosColNormalUVVertex));
- delete v;
+ delete [] v;
// pd->DrawPrimitive( D3DPT_TRIANGLESTRIP, i*2*(del_y+1), 2*del_y );
}
diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp
index 71e32c7..d04141b 100644
--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp
+++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp
@@ -634,7 +634,7 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v
}
}
if (supported_modes)
- delete supported_modes;
+ delete [] supported_modes;
}
void CEGLNativeTypeRaspberryPI::TvServiceCallback(uint32_t reason, uint32_t param1, uint32_t param2)
--
1.7.10

View File

@@ -1,174 +0,0 @@
From 6e28059b93220b1188461bfc99709cf7d27ae11c Mon Sep 17 00:00:00 2001
From: norbini <norbini@norbini.co.uk>
Date: Wed, 9 Jan 2013 23:08:02 +0000
Subject: [PATCH] Override CSFTPDirectory::Exists() method to correctly report
whether an SFTP url represents a directory or not. Fixes
ticket #13784.
Refactored CSFTPSession::Exists() into FileExists() and DirectoryExists() methods, and have CSFTPFile and CSFTPDirectory classes use them.
This means that Exists() calls on these classes correctly only return true if the url refers to an item of the appropriate type (e.g. a file or a directory).
---
xbmc/filesystem/SFTPDirectory.cpp | 15 ++++++++++
xbmc/filesystem/SFTPDirectory.h | 1 +
xbmc/filesystem/SFTPFile.cpp | 55 +++++++++++++++++++++++++++++--------
xbmc/filesystem/SFTPFile.h | 4 ++-
4 files changed, 63 insertions(+), 12 deletions(-)
diff --git a/xbmc/filesystem/SFTPDirectory.cpp b/xbmc/filesystem/SFTPDirectory.cpp
index ed04eb2..a7d7c93 100644
--- a/xbmc/filesystem/SFTPDirectory.cpp
+++ b/xbmc/filesystem/SFTPDirectory.cpp
@@ -20,6 +20,7 @@
#include "SFTPDirectory.h"
#ifdef HAS_FILESYSTEM_SFTP
+#include "utils/log.h"
#include "URL.h"
using namespace XFILE;
@@ -39,4 +40,18 @@ bool CSFTPDirectory::GetDirectory(const CStdString& strPath, CFileItemList &item
CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url);
return session->GetDirectory(url.GetWithoutFilename().c_str(), url.GetFileName().c_str(), items);
}
+
+bool CSFTPDirectory::Exists(const char* strPath)
+{
+ CURL url(strPath);
+
+ CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url);
+ if (session)
+ return session->DirectoryExists(url.GetFileName().c_str());
+ else
+ {
+ CLog::Log(LOGERROR, "SFTPDirectory: Failed to create session to check exists");
+ return false;
+ }
+}
#endif
diff --git a/xbmc/filesystem/SFTPDirectory.h b/xbmc/filesystem/SFTPDirectory.h
index 82ef542..bc94a83 100644
--- a/xbmc/filesystem/SFTPDirectory.h
+++ b/xbmc/filesystem/SFTPDirectory.h
@@ -35,6 +35,7 @@
CSFTPDirectory(void);
virtual ~CSFTPDirectory(void);
virtual bool GetDirectory(const CStdString& strPath, CFileItemList &items);
+ virtual bool Exists(const char* strPath);
};
}
#endif
diff --git a/xbmc/filesystem/SFTPFile.cpp b/xbmc/filesystem/SFTPFile.cpp
index d176969..34b797f 100644
--- a/xbmc/filesystem/SFTPFile.cpp
+++ b/xbmc/filesystem/SFTPFile.cpp
@@ -35,6 +35,11 @@
#pragma comment(lib, "ssh.lib")
#endif
+#ifdef TARGET_WINDOWS
+#define S_ISDIR(m) ((m & _S_IFDIR) != 0)
+#define S_ISREG(m) ((m & _S_IFREG) != 0)
+#endif
+
#ifdef _MSC_VER
#define O_RDONLY _O_RDONLY
#endif
@@ -187,19 +192,20 @@ bool CSFTPSession::GetDirectory(const CStdString &base, const CStdString &folder
return false;
}
-bool CSFTPSession::Exists(const char *path)
+bool CSFTPSession::DirectoryExists(const char *path)
{
bool exists = false;
- CSingleLock lock(m_critSect);
- if(m_connected)
- {
- sftp_attributes attributes = sftp_stat(m_sftp_session, CorrectPath(path).c_str());
- exists = attributes != NULL;
+ uint32_t permissions = 0;
+ exists = GetItemPermissions(path, permissions);
+ return exists && S_ISDIR(permissions);
+}
- if (attributes)
- sftp_attributes_free(attributes);
- }
- return exists;
+bool CSFTPSession::FileExists(const char *path)
+{
+ bool exists = false;
+ uint32_t permissions = 0;
+ exists = GetItemPermissions(path, permissions);
+ return exists && S_ISREG(permissions);
}
int CSFTPSession::Stat(const char *path, struct __stat64* buffer)
@@ -422,6 +428,33 @@ void CSFTPSession::Disconnect()
m_session = NULL;
}
+/*!
+ \brief Gets POSIX compatible permissions information about the specified file or directory.
+ \param path Remote SSH path to the file or directory.
+ \param permissions POSIX compatible permissions information for the file or directory (if it exists). i.e. can use macros S_ISDIR() etc.
+ \return Returns \e true, if it was possible to get permissions for the file or directory, \e false otherwise.
+ */
+bool CSFTPSession::GetItemPermissions(const char *path, uint32_t &permissions)
+{
+ bool gotPermissions = false;
+ CSingleLock lock(m_critSect);
+ if(m_connected)
+ {
+ sftp_attributes attributes = sftp_stat(m_sftp_session, CorrectPath(path).c_str());
+ if (attributes)
+ {
+ if (attributes->flags & SSH_FILEXFER_ATTR_PERMISSIONS)
+ {
+ permissions = attributes->permissions;
+ gotPermissions = true;
+ }
+
+ sftp_attributes_free(attributes);
+ }
+ }
+ return gotPermissions;
+}
+
CCriticalSection CSFTPSessionManager::m_critSect;
map<CStdString, CSFTPSessionPtr> CSFTPSessionManager::sessions;
@@ -554,7 +587,7 @@ bool CSFTPFile::Exists(const CURL& url)
{
CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url);
if (session)
- return session->Exists(url.GetFileName().c_str());
+ return session->FileExists(url.GetFileName().c_str());
else
{
CLog::Log(LOGERROR, "SFTPFile: Failed to create session to check exists");
diff --git a/xbmc/filesystem/SFTPFile.h b/xbmc/filesystem/SFTPFile.h
index 7d3574c..1ac83c8 100644
--- a/xbmc/filesystem/SFTPFile.h
+++ b/xbmc/filesystem/SFTPFile.h
@@ -58,7 +58,8 @@ class CSFTPSession
sftp_file CreateFileHande(const CStdString &file);
void CloseFileHandle(sftp_file handle);
bool GetDirectory(const CStdString &base, const CStdString &folder, CFileItemList &items);
- bool Exists(const char *path);
+ bool DirectoryExists(const char *path);
+ bool FileExists(const char *path);
int Stat(const char *path, struct __stat64* buffer);
int Seek(sftp_file handle, uint64_t position);
int Read(sftp_file handle, void *buffer, size_t length);
@@ -68,6 +69,7 @@ class CSFTPSession
bool VerifyKnownHost(ssh_session session);
bool Connect(const CStdString &host, unsigned int port, const CStdString &username, const CStdString &password);
void Disconnect();
+ bool GetItemPermissions(const char *path, uint32_t &permissions);
CCriticalSection m_critSect;
bool m_connected;
--
1.7.10

View File

@@ -1,420 +0,0 @@
From 4ffe9d056514aee9728a707f15f8eb78b71fd202 Mon Sep 17 00:00:00 2001
From: fritsch <peter.fruehberger@gmail.com>
Date: Sun, 10 Feb 2013 21:49:31 +0100
Subject: [PATCH 1/5] AE: Linux AE - some fixes of yesterday merge (Enumerate
+ Resume)
---
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
index 96a9a72..20af5a1 100644
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
@@ -1024,7 +1024,7 @@ bool CSoftAE::Resume()
{
#if defined(TARGET_LINUX)
// We must make sure, that we don't return empty.
- if(m_isSuspended || m_sinkInfoList.empty())
+ if(m_sinkInfoList.empty())
{
CLog::Log(LOGDEBUG, "CSoftAE::Resume - Re Enumerating Sinks");
CExclusiveLock sinkLock(m_sinkLock);
@@ -1095,6 +1095,12 @@ void CSoftAE::Run()
/* if we are told to restart */
if (m_reOpen || restart || !m_sink)
{
+ if(m_sinkIsSuspended && m_sink)
+ {
+ m_reOpen = m_reOpen || m_sink->SoftResume();
+ m_sinkIsSuspended = false;
+ CLog::Log(LOGDEBUG, "CSoftAE::Run - Sink was forgotten");
+ }
CLog::Log(LOGDEBUG, "CSoftAE::Run - Sink restart flagged");
InternalOpenSink();
}
--
1.7.10
From 934a29f37b97f7c7b43a9da7086765f1134428a4 Mon Sep 17 00:00:00 2001
From: fritsch <peter.fruehberger@gmail.com>
Date: Mon, 11 Feb 2013 00:08:05 +0100
Subject: [PATCH 2/5] AE: in doubt restore old suspend behaviour
---
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp | 49 +++++++++++++++-------
1 file changed, 33 insertions(+), 16 deletions(-)
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
index 20af5a1..0f6c6ed 100644
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
@@ -989,32 +989,50 @@ bool CSoftAE::Suspend()
CSoftAEStream *stream = *itt;
stream->Flush();
}
+ streamLock.Leave();
#if defined(TARGET_LINUX)
/*workaround sinks not playing sound after resume */
StopAllSounds();
- CExclusiveLock sinkLock(m_sinkLock);
- for (AESinkInfoList::iterator itt = m_sinkInfoList.begin(); itt != m_sinkInfoList.end(); ++itt)
- {
- itt->m_deviceInfoList.pop_back();
- }
+ bool ret = true;
if(m_sink)
{
/* Deinitialize and delete current m_sink */
// we don't want that Run reopens our device, so we wait.
m_saveSuspend.Reset();
// wait until we are looping in ProcessSuspend()
- m_saveSuspend.Wait();
- m_sink->Drain();
- m_sink->Deinitialize();
- delete m_sink;
- m_sink = NULL;
- // signal anybody, that the sink is closed now
- // this should help us not to run into deadlocks
- if(m_closeSink)
- m_closeEvent.Set();
+ // this is more save to not come up unclean
+ // we cannot wait forever
+ ret = m_saveSuspend.WaitMSec(500);
+ if(ret)
+ {
+ CLog::Log(LOGDEBUG, "CSoftAE::Suspend - After Event");
+ CExclusiveLock sinkLock(m_sinkLock);
+ // remove all the sinks
+ for (AESinkInfoList::iterator itt = m_sinkInfoList.begin(); itt != m_sinkInfoList.end(); ++itt)
+ {
+ itt->m_deviceInfoList.pop_back();
+ }
+ m_sink->Drain();
+ m_sink->Deinitialize();
+ delete m_sink;
+ m_sink = NULL;
+ }
+ else
+ {
+ CLog::Log(LOGDEBUG, "CSoftAE::Suspend - Unload failed will continue");
+ m_saveSuspend.Reset();
+ }
}
// The device list is now empty and must be reenumerated afterwards.
- m_sinkInfoList.clear();
+ if(ret)
+ m_sinkInfoList.clear();
+
+ // signal anybody, that we are gone now (beware of deadlocks)
+ // we don't unset the fields here, to care for reinit after resume
+ if(m_closeSink)
+ m_closeEvent.Set();
+ if(m_reOpen)
+ m_reOpenEvent.Set();
#endif
return true;
@@ -1378,7 +1396,6 @@ unsigned int CSoftAE::RunRawStreamStage(unsigned int channelCount, void *out, bo
StreamList resumeStreams;
static StreamList::iterator itt;
CSingleLock streamLock(m_streamLock);
-
/* handle playing streams */
for (itt = m_playingStreams.begin(); itt != m_playingStreams.end(); ++itt)
{
--
1.7.10
From cfa7d8d2ca9aa5641f5a6cb5169b2c19c0990992 Mon Sep 17 00:00:00 2001
From: fritsch <peter.fruehberger@gmail.com>
Date: Mon, 11 Feb 2013 03:08:42 +0100
Subject: [PATCH 3/5] AE: Choose indirection when possible. Care for lazy
evaluation
---
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp | 46 ++++++----------------
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h | 2 -
xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 11 +++---
3 files changed, 18 insertions(+), 41 deletions(-)
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
index 0f6c6ed..dc01abe 100644
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
@@ -59,7 +59,6 @@
m_audiophile (true ),
m_running (false ),
m_reOpen (false ),
- m_closeSink (false ),
m_sinkIsSuspended (false ),
m_isSuspended (false ),
m_softSuspend (false ),
@@ -189,8 +188,6 @@ void CSoftAE::InternalCloseSink()
delete m_sink;
m_sink = NULL;
}
- m_closeSink = false;
- m_closeEvent.Set();
}
/* this must NEVER be called from outside the main thread or Initialization */
void CSoftAE::InternalOpenSink()
@@ -732,7 +729,7 @@ void CSoftAE::PauseStream(CSoftAEStream *stream)
stream->m_paused = true;
streamLock.Leave();
- OpenSink();
+ m_reOpen = true;
}
void CSoftAE::ResumeStream(CSoftAEStream *stream)
@@ -743,7 +740,7 @@ void CSoftAE::ResumeStream(CSoftAEStream *stream)
streamLock.Leave();
m_streamsPlaying = true;
- OpenSink();
+ m_reOpen = true;
}
void CSoftAE::Stop()
@@ -780,7 +777,7 @@ IAEStream *CSoftAE::MakeStream(enum AEDataFormat dataFormat, unsigned int sample
CSoftAEStream *stream = new CSoftAEStream(dataFormat, sampleRate, encodedSampleRate, channelLayout, options);
m_newStreams.push_back(stream);
streamLock.Leave();
-
+ // this is really needed here
OpenSink();
return stream;
}
@@ -873,17 +870,9 @@ IAEStream *CSoftAE::FreeStream(IAEStream *stream)
RemoveStream(m_playingStreams, (CSoftAEStream*)stream);
RemoveStream(m_streams , (CSoftAEStream*)stream);
lock.Leave();
- // Close completely when we go to suspend, reopen as it was old behaviour.
- // Not opening when masterstream stops means clipping on S/PDIF.
- if(m_isSuspended)
- {
- m_closeEvent.Reset();
- m_closeSink = true;
- m_closeEvent.Wait();
- m_wake.Set();
- }
- else if (m_masterStream == stream)
- OpenSink();
+ // Reopen is old behaviour. Not opening when masterstream stops means clipping on S/PDIF.
+ if(!m_isSuspended && (m_masterStream == stream))
+ m_reOpen = true;
delete (CSoftAEStream*)stream;
return NULL;
@@ -1012,10 +1001,7 @@ bool CSoftAE::Suspend()
{
itt->m_deviceInfoList.pop_back();
}
- m_sink->Drain();
- m_sink->Deinitialize();
- delete m_sink;
- m_sink = NULL;
+ InternalCloseSink();
}
else
{
@@ -1029,8 +1015,6 @@ bool CSoftAE::Suspend()
// signal anybody, that we are gone now (beware of deadlocks)
// we don't unset the fields here, to care for reinit after resume
- if(m_closeSink)
- m_closeEvent.Set();
if(m_reOpen)
m_reOpenEvent.Set();
#endif
@@ -1075,10 +1059,10 @@ void CSoftAE::Run()
// ProcessSuspending() cannot guarantee that we get our sink back softresumed
// that is a big problem as another thread could start adding packets
// this must be checked here, before writing anything on the sinks
- if(m_sinkIsSuspended)
+ if(m_sinkIsSuspended && m_sink)
{
CLog::Log(LOGDEBUG, "CSoftAE::Run - Someone has forgotten to resume us (device resumed)");
- m_sink->SoftResume();
+ m_reOpen = !m_sink->SoftResume() || m_reOpen;
m_sinkIsSuspended = false;
}
if ((this->*m_outputStageFn)(hasAudio) > 0)
@@ -1101,12 +1085,6 @@ void CSoftAE::Run()
restart = true;
}
- //we are told to close the sink
- if(m_closeSink)
- {
- InternalCloseSink();
- }
-
/* Handle idle or forced suspend */
ProcessSuspend();
@@ -1115,7 +1093,8 @@ void CSoftAE::Run()
{
if(m_sinkIsSuspended && m_sink)
{
- m_reOpen = m_reOpen || m_sink->SoftResume();
+ // hint for fritsch: remember lazy evaluation
+ m_reOpen = !m_sink->SoftResume() || m_reOpen;
m_sinkIsSuspended = false;
CLog::Log(LOGDEBUG, "CSoftAE::Run - Sink was forgotten");
}
@@ -1505,7 +1484,6 @@ inline void CSoftAE::RemoveStream(StreamList &streams, CSoftAEStream *stream)
inline void CSoftAE::ProcessSuspend()
{
- m_sinkIsSuspended = false;
unsigned int curSystemClock = 0;
#if defined(TARGET_WINDOWS) || defined(TARGET_LINUX)
if (!m_softSuspend && m_playingStreams.empty() && m_playing_sounds.empty() &&
@@ -1563,7 +1541,7 @@ inline void CSoftAE::ProcessSuspend()
*/
if (!m_isSuspended && (!m_playingStreams.empty() || !m_playing_sounds.empty()))
{
- m_reOpen = m_reOpen || !m_sink->SoftResume(); // sink returns false if it requires reinit
+ m_reOpen = !m_sink->SoftResume() || m_reOpen; // sink returns false if it requires reinit (worthless with current implementation)
m_sinkIsSuspended = false; //sink processing data
m_softSuspend = false; //break suspend loop (under some conditions)
CLog::Log(LOGDEBUG, "Resumed the Sink");
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
index 559e055..26d5e9c 100644
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
@@ -137,14 +137,12 @@ class CSoftAE : public IThreadedAE
/* internal vars */
bool m_running, m_reOpen;
- bool m_closeSink;
bool m_sinkIsSuspended; /* The sink is in unusable state, e.g. SoftSuspended */
bool m_isSuspended; /* engine suspended by external function to release audio context */
bool m_softSuspend; /* latches after last stream or sound played for timer below for idle */
unsigned int m_softSuspendTimer; /* time in milliseconds to hold sink open before soft suspend for idle */
CEvent m_reOpenEvent;
CEvent m_wake;
- CEvent m_closeEvent;
CEvent m_saveSuspend;
CCriticalSection m_runningLock; /* released when the thread exits */
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
index b06d358..fe40d17 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
@@ -1144,16 +1144,17 @@ bool CAESinkALSA::SoftSuspend()
}
bool CAESinkALSA::SoftResume()
{
- // reinit all the clibber
+ // reinit all the clibber
+ bool ret = true; // all fine
if(!m_pcm)
{
if (!snd_config)
- snd_config_update();
+ snd_config_update();
- Initialize(m_initFormat, m_initDevice);
+ ret = Initialize(m_initFormat, m_initDevice);
}
- //we want that AE loves us again
- return false; // force reinit
+ //we want that AE loves us again - reinit when initialize failed
+ return ret; // force reinit if false
}
void CAESinkALSA::sndLibErrorHandler(const char *file, int line, const char *function, int err, const char *fmt, ...)
--
1.7.10
From 87cc3d07ec7eb27c065920f0741e649f72b86acd Mon Sep 17 00:00:00 2001
From: fritsch <peter.fruehberger@gmail.com>
Date: Tue, 12 Feb 2013 22:29:27 +0100
Subject: [PATCH 4/5] AE: make sure we reOpen when the flag is set or we run
into trouble
---
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
index dc01abe..085ae30 100644
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
@@ -1055,21 +1055,12 @@ void CSoftAE::Run()
{
bool restart = false;
- /* Clean Up what the suspend guy might have forgotten */
- // ProcessSuspending() cannot guarantee that we get our sink back softresumed
- // that is a big problem as another thread could start adding packets
- // this must be checked here, before writing anything on the sinks
- if(m_sinkIsSuspended && m_sink)
- {
- CLog::Log(LOGDEBUG, "CSoftAE::Run - Someone has forgotten to resume us (device resumed)");
- m_reOpen = !m_sink->SoftResume() || m_reOpen;
- m_sinkIsSuspended = false;
- }
- if ((this->*m_outputStageFn)(hasAudio) > 0)
+ /* with the new non blocking implementation - we just reOpen here, when it tells reOpen */
+ if (!m_reOpen && (this->*m_outputStageFn)(hasAudio) > 0)
hasAudio = false; /* taken some audio - reset our silence flag */
/* if we have enough room in the buffer */
- if (m_buffer.Free() >= m_frameSize)
+ if (!m_reOpen && m_buffer.Free() >= m_frameSize)
{
/* take some data for our use from the buffer */
uint8_t *out = (uint8_t*)m_buffer.Take(m_frameSize);
--
1.7.10
From d6b5df01dee73bf3a6bf4c88c9aeb242396a7b69 Mon Sep 17 00:00:00 2001
From: fritsch <peter.fruehberger@gmail.com>
Date: Wed, 13 Feb 2013 08:34:09 +0100
Subject: [PATCH 5/5] AE: hold streamlock longer in FreeStream until the data
is gone (could still be used in Output Stage)
---
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
index 085ae30..3dcdcd7 100644
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
@@ -730,6 +730,7 @@ void CSoftAE::PauseStream(CSoftAEStream *stream)
streamLock.Leave();
m_reOpen = true;
+ m_wake.Set();
}
void CSoftAE::ResumeStream(CSoftAEStream *stream)
@@ -741,6 +742,7 @@ void CSoftAE::ResumeStream(CSoftAEStream *stream)
m_streamsPlaying = true;
m_reOpen = true;
+ m_wake.Set();
}
void CSoftAE::Stop()
@@ -869,7 +871,6 @@ IAEStream *CSoftAE::FreeStream(IAEStream *stream)
CSingleLock lock(m_streamLock);
RemoveStream(m_playingStreams, (CSoftAEStream*)stream);
RemoveStream(m_streams , (CSoftAEStream*)stream);
- lock.Leave();
// Reopen is old behaviour. Not opening when masterstream stops means clipping on S/PDIF.
if(!m_isSuspended && (m_masterStream == stream))
m_reOpen = true;
--
1.7.10

View File

@@ -1,53 +0,0 @@
From 8b6032793bcc05a6ec06773c95463a22d2c9881b Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Fri, 15 Feb 2013 17:58:41 +0000
Subject: [PATCH] [rbp] Fix for hang after seeking introduced by ASS fix
#2206 introduced a regression when seeking in some types of SD files where the video stutters and/or stalls.
This is caused by using the wrong clock in FlipPage
---
xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
index ec7e7f6..5a6e31e 100644
--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
@@ -461,15 +461,15 @@ void OMXPlayerVideo::Output(int iGroupId, double pts, bool bDropPacket)
m_iSleepEndTime = iCurrentClock + iSleepTime;
}
- if (!CThread::m_bStop && m_av_clock->GetAbsoluteClock(false) < m_iSleepEndTime)
+ if (!CThread::m_bStop && m_av_clock->GetAbsoluteClock(false) < m_iSleepEndTime + DVD_MSEC_TO_TIME(500))
return;
- m_iSleepEndTime = DVD_NOPTS_VALUE;
-
double pts_media = m_av_clock->OMXMediaTime(false, false);
ProcessOverlays(iGroupId, pts_media);
- g_renderManager.FlipPage(CThread::m_bStop, pts_media / DVD_TIME_BASE, -1, FS_NONE);
+ g_renderManager.FlipPage(CThread::m_bStop, m_iSleepEndTime / DVD_TIME_BASE, -1, FS_NONE);
+
+ m_iSleepEndTime = DVD_NOPTS_VALUE;
//m_av_clock->WaitAbsoluteClock((iCurrentClock + iSleepTime));
}
@@ -580,12 +580,14 @@ void OMXPlayerVideo::Process()
m_av_clock->OMXReset(false);
m_av_clock->UnLock();
m_started = false;
+ m_iSleepEndTime = DVD_NOPTS_VALUE;
}
else if (pMsg->IsType(CDVDMsg::GENERAL_FLUSH)) // private message sent by (COMXPlayerVideo::Flush())
{
CLog::Log(LOGDEBUG, "COMXPlayerVideo - CDVDMsg::GENERAL_FLUSH");
m_stalled = true;
m_started = false;
+ m_iSleepEndTime = DVD_NOPTS_VALUE;
m_av_clock->Lock();
m_av_clock->OMXStop(false);
m_omxVideo.Reset();
--
1.7.10

View File

@@ -20,7 +20,7 @@
################################################################################
PKG_NAME="xbmc"
PKG_VERSION="12.0.1"
PKG_VERSION="12.0.2"
GIT_REPO="-b Frodo git://github.com/xbmc/xbmc.git"
DEST_DIR="$PKG_NAME-frodo"