xbmc: update to xbmc-13.alpha-4298c43

This commit is contained in:
Stefan Saraev 2014-02-21 21:28:53 +02:00
parent c79734b4bb
commit ac9bc15217
3 changed files with 2 additions and 306 deletions

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="xbmc-theme-Confluence"
PKG_VERSION="13.alpha-6204232"
PKG_VERSION="13.alpha-4298c43"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="xbmc"
PKG_VERSION="13.alpha-6204232"
PKG_VERSION="13.alpha-4298c43"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -1,304 +0,0 @@
From 63de0e201993d4d4ce245afd7ac9187324ecb200 Mon Sep 17 00:00:00 2001
From: Rainer Hochecker <fernetmenta@online.de>
Date: Sun, 2 Feb 2014 13:01:09 +0100
Subject: [PATCH 1/3] ActiveAE: add method for re-init after device/eld change
---
xbmc/cores/AudioEngine/AEFactory.cpp | 6 ++++
xbmc/cores/AudioEngine/AEFactory.h | 1 +
.../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 34 ++++++++++++++++++++++
xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h | 4 +++
xbmc/cores/AudioEngine/Interfaces/AE.h | 5 ++++
5 files changed, 50 insertions(+)
diff --git a/xbmc/cores/AudioEngine/AEFactory.cpp b/xbmc/cores/AudioEngine/AEFactory.cpp
index 3094bdf..fff42a6 100644
--- a/xbmc/cores/AudioEngine/AEFactory.cpp
+++ b/xbmc/cores/AudioEngine/AEFactory.cpp
@@ -404,3 +404,9 @@ void CAEFactory::KeepConfiguration(unsigned int millis)
if (AE)
AE->KeepConfiguration(millis);
}
+
+void CAEFactory::DeviceChange()
+{
+ if (AE)
+ AE->DeviceChange();
+}
diff --git a/xbmc/cores/AudioEngine/AEFactory.h b/xbmc/cores/AudioEngine/AEFactory.h
index 9a340cc..1d55513 100644
--- a/xbmc/cores/AudioEngine/AEFactory.h
+++ b/xbmc/cores/AudioEngine/AEFactory.h
@@ -76,6 +76,7 @@ class CAEFactory
static void SettingOptionsAudioStreamsilenceFiller(const CSetting *setting, std::vector< std::pair<std::string, int> > &list, int &current);
static bool IsSettingVisible(const std::string &condition, const std::string &value, const std::string &settingId);
static void KeepConfiguration(unsigned int millis);
+ static void DeviceChange();
static void RegisterAudioCallback(IAudioCallback* pCallback);
static void UnregisterAudioCallback();
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
index 0a4aba0..d363c88 100644
--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
@@ -425,6 +425,35 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg)
}
msg->Reply(CActiveAEControlProtocol::ACC);
return;
+ case CActiveAEControlProtocol::DEVICECHANGE:
+ time_t now;
+ time(&now);
+ while (!m_extLastDeviceChange.empty() && (now - m_extLastDeviceChange.front() > 0))
+ {
+ m_extLastDeviceChange.pop();
+ }
+ if (m_extLastDeviceChange.size() > 2)
+ {
+ CLog::Log(LOGWARNING,"CActiveAE - received %ld device change events within one second", m_extLastDeviceChange.size());
+ return;
+ }
+ m_extLastDeviceChange.push(now);
+ UnconfigureSink();
+ m_sink.EnumerateSinkList(true);
+ LoadSettings();
+ m_extError = false;
+ Configure();
+ if (!m_extError)
+ {
+ m_state = AE_TOP_CONFIGURED_PLAY;
+ m_extTimeout = 0;
+ }
+ else
+ {
+ m_state = AE_TOP_ERROR;
+ m_extTimeout = 500;
+ }
+ return;
case CActiveAEControlProtocol::PAUSESTREAM:
CActiveAEStream *stream;
stream = *(CActiveAEStream**)msg->data;
@@ -2269,6 +2298,11 @@ void CActiveAE::KeepConfiguration(unsigned int millis)
m_controlPort.SendOutMessage(CActiveAEControlProtocol::KEEPCONFIG, &timeMs, sizeof(unsigned int));
}
+void CActiveAE::DeviceChange()
+{
+ m_controlPort.SendOutMessage(CActiveAEControlProtocol::DEVICECHANGE);
+}
+
void CActiveAE::OnLostDevice()
{
Message *reply;
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h
index debc8e1..225c694 100644
--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h
+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h
@@ -28,6 +28,7 @@
#include "cores/AudioEngine/Interfaces/AESound.h"
#include "cores/AudioEngine/AEFactory.h"
#include "guilib/DispResource.h"
+#include <queue>
// ffmpeg
#include "DllAvFormat.h"
@@ -73,6 +74,7 @@ class CActiveAEControlProtocol : public Protocol
INIT = 0,
RECONFIGURE,
SUSPEND,
+ DEVICECHANGE,
MUTE,
VOLUME,
PAUSESTREAM,
@@ -224,6 +226,7 @@ class CActiveAE : public IAE, private CThread
virtual bool SupportsQualityLevel(enum AEQuality level);
virtual bool IsSettingVisible(const std::string &settingId);
virtual void KeepConfiguration(unsigned int millis);
+ virtual void DeviceChange();
virtual void RegisterAudioCallback(IAudioCallback* pCallback);
virtual void UnregisterAudioCallback();
@@ -292,6 +295,7 @@ class CActiveAE : public IAE, private CThread
XbmcThreads::EndTime m_extDrainTimer;
unsigned int m_extKeepConfig;
bool m_extDeferData;
+ std::queue<time_t> m_extLastDeviceChange;
enum
{
diff --git a/xbmc/cores/AudioEngine/Interfaces/AE.h b/xbmc/cores/AudioEngine/Interfaces/AE.h
index f91dc4c..dd32897 100644
--- a/xbmc/cores/AudioEngine/Interfaces/AE.h
+++ b/xbmc/cores/AudioEngine/Interfaces/AE.h
@@ -232,5 +232,10 @@ class IAE
* @param millis time for which old configuration should be kept
*/
virtual void KeepConfiguration(unsigned int millis) {return; }
+
+ /**
+ * Instruct AE to re-initialize, e.g. after ELD change event
+ */
+ virtual void DeviceChange() {return; }
};
--
1.8.5.1
From e2ec5c813f726351d43dae210288bef43bdb19e6 Mon Sep 17 00:00:00 2001
From: fritsch <Peter.Fruehberger@gmail.com>
Date: Mon, 3 Feb 2014 19:57:19 +0100
Subject: [PATCH 2/3] AESinkPULSE: Use Callback to use Factory's DeviceChange()
---
xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp | 46 ++++++++++++++++++++++++++--
xbmc/cores/AudioEngine/Sinks/AESinkPULSE.h | 4 +++
2 files changed, 47 insertions(+), 3 deletions(-)
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp
index a04a2a8..8888880 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp
@@ -189,6 +189,29 @@ static void StreamLatencyUpdateCallback(pa_stream *s, void *userdata)
pa_threaded_mainloop *m = (pa_threaded_mainloop *)userdata;
pa_threaded_mainloop_signal(m, 0);
}
+
+static void SinkChangedCallback(pa_context *c, pa_subscription_event_type_t t, uint32_t idx, void *userdata)
+{
+ CAESinkPULSE* p = (CAESinkPULSE*) userdata;
+ if(!p)
+ return;
+
+ CSingleLock lock(p->m_sec);
+ if (p->InitDone())
+ {
+ if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_NEW)
+ {
+ CLog::Log(LOGDEBUG, "Sink appeared");
+ CAEFactory::DeviceChange();
+ }
+ else if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE)
+ {
+ CLog::Log(LOGDEBUG, "Sink removed");
+ CAEFactory::DeviceChange();
+ }
+ }
+}
+
struct SinkInfoStruct
{
AEDeviceInfoList *list;
@@ -406,7 +429,10 @@ static void SinkInfoRequestCallback(pa_context *c, const pa_sink_info *i, int eo
bool CAESinkPULSE::Initialize(AEAudioFormat &format, std::string &device)
{
- m_IsAllocated = false;
+ {
+ CSingleLock lock(m_sec);
+ m_IsAllocated = false;
+ }
m_passthrough = false;
m_BytesPerSecond = 0;
m_BufferSize = 0;
@@ -423,6 +449,16 @@ bool CAESinkPULSE::Initialize(AEAudioFormat &format, std::string &device)
pa_threaded_mainloop_lock(m_MainLoop);
+ {
+ // Register Callback for Sink changes
+ CSingleLock lock(m_sec);
+ pa_context_set_subscribe_callback(m_Context, SinkChangedCallback, this);
+ const pa_subscription_mask_t mask = PA_SUBSCRIPTION_MASK_SINK;
+ pa_operation *op = pa_context_subscribe(m_Context, mask, NULL, this);
+ if (op != NULL)
+ pa_operation_unref(op);
+ }
+
struct pa_channel_map map;
pa_channel_map_init(&map);
@@ -595,20 +631,24 @@ bool CAESinkPULSE::Initialize(AEAudioFormat &format, std::string &device)
}
pa_threaded_mainloop_unlock(m_MainLoop);
-
- m_IsAllocated = true;
+
format.m_frameSize = frameSize;
format.m_frameSamples = format.m_frames * format.m_channelLayout.Count();
m_format = format;
format.m_dataFormat = m_passthrough ? AE_FMT_S16NE : format.m_dataFormat;
Pause(false);
+ {
+ CSingleLock lock(m_sec);
+ m_IsAllocated = true;
+ }
return true;
}
void CAESinkPULSE::Deinitialize()
{
+ CSingleLock lock(m_sec);
m_IsAllocated = false;
m_passthrough = false;
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.h b/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.h
index 9fa301f..1a2284d 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.h
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.h
@@ -22,9 +22,11 @@
#include "system.h"
#include "cores/AudioEngine/Interfaces/AESink.h"
+#include "cores/AudioEngine/AEFactory.h"
#include "Utils/AEDeviceInfo.h"
#include "Utils/AEUtil.h"
#include <pulse/pulseaudio.h>
+#include "threads/CriticalSection.h"
class CAESinkPULSE : public IAESink
{
@@ -46,6 +48,8 @@ class CAESinkPULSE : public IAESink
virtual void SetVolume(float volume);
static void EnumerateDevicesEx(AEDeviceInfoList &list, bool force = false);
+ inline bool InitDone() { return m_IsAllocated; };
+ CCriticalSection m_sec;
private:
bool Pause(bool pause);
static inline bool WaitForOperation(pa_operation *op, pa_threaded_mainloop *mainloop, const char *LogEntry);
--
1.8.5.1
From 3bc44eab85cc050bfd4b53d2d80f4afdf5822855 Mon Sep 17 00:00:00 2001
From: fritsch <Peter.Fruehberger@gmail.com>
Date: Wed, 5 Feb 2014 09:21:38 +0100
Subject: [PATCH 3/3] AESinkPULSE: Track Change Event again - don't do anything
for now
---
xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp
index 8888880..21131ae 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp
@@ -209,6 +209,11 @@ static void SinkChangedCallback(pa_context *c, pa_subscription_event_type_t t, u
CLog::Log(LOGDEBUG, "Sink removed");
CAEFactory::DeviceChange();
}
+ else if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_CHANGE)
+ {
+ CLog::Log(LOGDEBUG, "Sink changed");
+ //CAEFactory::DeviceChange();
+ }
}
}
--
1.8.5.1