summaryrefslogtreecommitdiffstats
path: root/xbmc/cores
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 09:25:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 09:25:13 +0000
commite353c8eff2bef4b84c539d4c03dc7c0a5adf9f9b (patch)
tree7ac20f83cf66e65d9e27e7be128f2142324466d7 /xbmc/cores
parentAdding upstream version 2:20.4+dfsg. (diff)
downloadkodi-upstream.tar.xz
kodi-upstream.zip
Adding upstream version 2:20.5+dfsg.upstream/2%20.5+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xbmc/cores')
-rw-r--r--xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp7
-rw-r--r--xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
index a7fb55c..247ad52 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
@@ -11,7 +11,9 @@
#include "ServiceBroker.h"
#include "cores/AudioEngine/AESinkFactory.h"
#include "cores/AudioEngine/Utils/AEUtil.h"
+#include "settings/AdvancedSettings.h"
#include "settings/Settings.h"
+#include "settings/SettingsComponent.h"
#include "utils/StringUtils.h"
#include "utils/TimeUtils.h"
#include "utils/log.h"
@@ -421,6 +423,9 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
}
}
+ m_superviseAudioDelay =
+ CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_superviseAudioDelay;
+
int atChannelMask = AEChannelMapToAUDIOTRACKChannelMask(m_format.m_channelLayout);
m_format.m_channelLayout = AUDIOTRACKChannelMaskToAEChannelMap(atChannelMask);
if (m_encoding == CJNIAudioFormat::ENCODING_IEC61937)
@@ -848,7 +853,7 @@ unsigned int CAESinkAUDIOTRACK::AddPackets(uint8_t **data, unsigned int frames,
const double max_stuck_delay_ms = m_audiotrackbuffer_sec_orig * 2000.0;
const double stime_ms = 1000.0 * frames / m_format.m_sampleRate;
- if (m_stuckCounter * stime_ms > max_stuck_delay_ms)
+ if (m_superviseAudioDelay && (m_stuckCounter * stime_ms > max_stuck_delay_ms))
{
CLog::Log(LOGERROR, "Sink got stuck with {:f} ms - ask AE for reopening", max_stuck_delay_ms);
usleep(max_stuck_delay_ms * 1000);
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h
index 6e9ec76..c1d7360 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h
@@ -96,6 +96,7 @@ private:
double m_hw_delay = 0.0;
CJNIAudioTimestamp m_timestamp;
XbmcThreads::EndTime<> m_stampTimer;
+ bool m_superviseAudioDelay = false;
std::vector<float> m_floatbuf;
std::vector<int16_t> m_shortbuf;