From 43b857ba815ecf82cd9ac8b90d49937fa4a8a71a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 11:29:46 +0200 Subject: Merging upstream version 2:20.5+dfsg. Signed-off-by: Daniel Baumann --- xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp | 7 ++++++- xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'xbmc/cores') 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 m_floatbuf; std::vector m_shortbuf; -- cgit v1.2.3