mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-27 20:56:55 +00:00
xbmc: update PR2218 patch
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
d2a3685ac9
commit
f0299e531b
@ -1,42 +0,0 @@
|
|||||||
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] 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
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
From 9abc7d0311a3adc6e83d289d54c3e2d0fffc0d28 Mon Sep 17 00:00:00 2001
|
From 4ffe9d056514aee9728a707f15f8eb78b71fd202 Mon Sep 17 00:00:00 2001
|
||||||
From: fritsch <peter.fruehberger@gmail.com>
|
From: fritsch <peter.fruehberger@gmail.com>
|
||||||
Date: Sun, 10 Feb 2013 21:49:31 +0100
|
Date: Sun, 10 Feb 2013 21:49:31 +0100
|
||||||
Subject: [PATCH 1/3] AE: Linux AE - some fixes of yesterday merge (Enumerate
|
Subject: [PATCH 1/5] AE: Linux AE - some fixes of yesterday merge (Enumerate
|
||||||
+ Resume)
|
+ Resume)
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -38,10 +38,10 @@ index 96a9a72..20af5a1 100644
|
|||||||
1.7.10
|
1.7.10
|
||||||
|
|
||||||
|
|
||||||
From 3dfe32ce310b7543f58572f59c3c9223c38bae20 Mon Sep 17 00:00:00 2001
|
From 934a29f37b97f7c7b43a9da7086765f1134428a4 Mon Sep 17 00:00:00 2001
|
||||||
From: fritsch <peter.fruehberger@gmail.com>
|
From: fritsch <peter.fruehberger@gmail.com>
|
||||||
Date: Mon, 11 Feb 2013 00:08:05 +0100
|
Date: Mon, 11 Feb 2013 00:08:05 +0100
|
||||||
Subject: [PATCH 2/3] AE: in doubt restore old suspend behaviour
|
Subject: [PATCH 2/5] AE: in doubt restore old suspend behaviour
|
||||||
|
|
||||||
---
|
---
|
||||||
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp | 49 +++++++++++++++-------
|
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp | 49 +++++++++++++++-------
|
||||||
@ -129,17 +129,17 @@ index 20af5a1..0f6c6ed 100644
|
|||||||
1.7.10
|
1.7.10
|
||||||
|
|
||||||
|
|
||||||
From 9dfebbdd375a2447f9f0d326a40696885e637520 Mon Sep 17 00:00:00 2001
|
From cfa7d8d2ca9aa5641f5a6cb5169b2c19c0990992 Mon Sep 17 00:00:00 2001
|
||||||
From: fritsch <peter.fruehberger@gmail.com>
|
From: fritsch <peter.fruehberger@gmail.com>
|
||||||
Date: Mon, 11 Feb 2013 03:08:42 +0100
|
Date: Mon, 11 Feb 2013 03:08:42 +0100
|
||||||
Subject: [PATCH 3/3] AE: Choose indirection when possible. Care for lazy
|
Subject: [PATCH 3/5] AE: Choose indirection when possible. Care for lazy
|
||||||
evaluation
|
evaluation
|
||||||
|
|
||||||
---
|
---
|
||||||
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp | 46 ++++++----------------
|
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp | 46 ++++++----------------
|
||||||
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h | 2 -
|
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h | 2 -
|
||||||
xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 7 ++--
|
xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 11 +++---
|
||||||
3 files changed, 16 insertions(+), 39 deletions(-)
|
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
|
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||||
index 0f6c6ed..dc01abe 100644
|
index 0f6c6ed..dc01abe 100644
|
||||||
@ -304,18 +304,21 @@ index 559e055..26d5e9c 100644
|
|||||||
|
|
||||||
CCriticalSection m_runningLock; /* released when the thread exits */
|
CCriticalSection m_runningLock; /* released when the thread exits */
|
||||||
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
|
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
|
||||||
index b06d358..985c201 100644
|
index b06d358..fe40d17 100644
|
||||||
--- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
|
--- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
|
||||||
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
|
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
|
||||||
@@ -1145,15 +1145,16 @@ bool CAESinkALSA::SoftSuspend()
|
@@ -1144,16 +1144,17 @@ bool CAESinkALSA::SoftSuspend()
|
||||||
|
}
|
||||||
bool CAESinkALSA::SoftResume()
|
bool CAESinkALSA::SoftResume()
|
||||||
{
|
{
|
||||||
// reinit all the clibber
|
- // reinit all the clibber
|
||||||
+ bool ret = true; // all fine
|
+ // reinit all the clibber
|
||||||
|
+ bool ret = true; // all fine
|
||||||
if(!m_pcm)
|
if(!m_pcm)
|
||||||
{
|
{
|
||||||
if (!snd_config)
|
if (!snd_config)
|
||||||
snd_config_update();
|
- snd_config_update();
|
||||||
|
+ snd_config_update();
|
||||||
|
|
||||||
- Initialize(m_initFormat, m_initDevice);
|
- Initialize(m_initFormat, m_initDevice);
|
||||||
+ ret = Initialize(m_initFormat, m_initDevice);
|
+ ret = Initialize(m_initFormat, m_initDevice);
|
||||||
@ -330,3 +333,88 @@ index b06d358..985c201 100644
|
|||||||
--
|
--
|
||||||
1.7.10
|
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
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user