diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | project/cmake/CMakeLists.txt | 2 | ||||
-rw-r--r-- | project/cmake/modules/FindLCMS2.cmake | 48 | ||||
-rw-r--r-- | xbmc/cores/AudioEngine/Utils/AELimiter.h | 2 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoPlayer.cpp | 15 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoPlayer.h | 3 | ||||
-rw-r--r-- | xbmc/cores/paplayer/PAPlayer.cpp | 4 | ||||
-rw-r--r-- | xbmc/settings/AdvancedSettings.cpp | 2 |
8 files changed, 62 insertions, 16 deletions
diff --git a/.travis.yml b/.travis.yml index 21b6c3e537..e5097f85af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -71,7 +71,7 @@ install: - if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD" == "Kodi" ]]; then sudo apt-get install -qq automake autopoint build-essential cmake curl default-jre gawk gdb gdc gettext git-core gperf libasound2-dev libass-dev libbz2-dev libcap-dev libcdio-dev libcec4-dev libcrossguid-dev libcurl3 - libcurl4-openssl-dev libdbus-1-dev libfontconfig-dev libegl1-mesa-dev libfreetype6-dev libfribidi-dev libgif-dev + libcurl4-openssl-dev libdbus-1-dev libfontconfig-dev libegl1-mesa-dev libfreetype6-dev libfribidi-dev liblcms2-dev libgif-dev libiso9660-dev libjpeg-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libmysqlclient-dev libnfs-dev libpcre3-dev libplist-dev libpng-dev libpulse-dev libsdl2-dev libsmbclient-dev libsqlite3-dev libssh-dev libssl-dev libtag1-dev libtinyxml-dev libtool libudev-dev libusb-dev libva-dev libvdpau-dev diff --git a/project/cmake/CMakeLists.txt b/project/cmake/CMakeLists.txt index cebc751de6..aeb1ff47c2 100644 --- a/project/cmake/CMakeLists.txt +++ b/project/cmake/CMakeLists.txt @@ -115,7 +115,7 @@ if(CORE_SYSTEM_NAME STREQUAL android) endif() # Optional dependencies -set(optional_deps MicroHttpd MySqlClient SSH XSLT +set(optional_deps LCMS2 MicroHttpd MySqlClient SSH XSLT Alsa UDEV DBus Avahi SmbClient CCache PulseAudio VDPAU VAAPI Bluetooth CAP) diff --git a/project/cmake/modules/FindLCMS2.cmake b/project/cmake/modules/FindLCMS2.cmake new file mode 100644 index 0000000000..5ec7a77ba3 --- /dev/null +++ b/project/cmake/modules/FindLCMS2.cmake @@ -0,0 +1,48 @@ +#.rst: +# FindLCMS2 +# ----------- +# Finds the LCMS Color Management library +# +# This will will define the following variables:: +# +# LCMS2_FOUND - system has LCMS Color Management +# LCMS2_INCLUDE_DIRS - the LCMS Color Management include directory +# LCMS2_LIBRARIES - the LCMS Color Management libraries +# LCMS2_DEFINITIONS - the LCMS Color Management definitions +# +# and the following imported targets:: +# +# LCMS2::LCMS2 - The LCMS Color Management library + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_LCMS2 lcms2 QUIET) +endif() + +find_path(LCMS2_INCLUDE_DIR NAMES lcms2.h + PATHS ${PC_LCMS2_INCLUDEDIR}) +find_library(LCMS2_LIBRARY NAMES lcms2 liblcms2 + PATHS ${PC_LCMS2_LIBDIR}) + +set(LCMS2_VERSION ${PC_LCMS2_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LCMS2 + REQUIRED_VARS LCMS2_LIBRARY LCMS2_INCLUDE_DIR + VERSION_VAR LCMS2_VERSION) + +if(LCMS2_FOUND) + set(LCMS2_LIBRARIES ${LCMS2_LIBRARY}) + set(LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR}) + set(LCMS2_DEFINITIONS -DHAVE_LCMS2=1) + + if(NOT TARGET LCMS2::LCMS2) + add_library(LCMS2::LCMS2 UNKNOWN IMPORTED) + set_target_properties(LCMS2::LCMS2 PROPERTIES + IMPORTED_LOCATION "${LCMS2_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${LCMS2_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_LCMS2=1) + endif() +endif() + +mark_as_advanced(LCMS2_INCLUDE_DIR LCMS2_LIBRARY) + diff --git a/xbmc/cores/AudioEngine/Utils/AELimiter.h b/xbmc/cores/AudioEngine/Utils/AELimiter.h index 4918b56a16..6c4226a67c 100644 --- a/xbmc/cores/AudioEngine/Utils/AELimiter.h +++ b/xbmc/cores/AudioEngine/Utils/AELimiter.h @@ -36,7 +36,7 @@ class CAELimiter void SetAmplification(float amplify) { - m_amplify = std::max(std::min(amplify, 1000.0f), 1.0f); + m_amplify = std::max(std::min(amplify, 1000.0f), 0.0f); } float GetAmplification() diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp index defe4e44a4..f206847aa8 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp @@ -3841,33 +3841,30 @@ bool CVideoPlayer::OpenSubtitleStream(CDVDStreamInfo& hint) return true; } -bool CVideoPlayer::AdaptForcedSubtitles() +void CVideoPlayer::AdaptForcedSubtitles() { - bool valid = false; SelectionStream ss = m_SelectionStreams.Get(STREAM_SUBTITLE, GetSubtitle()); - if (ss.flags & CDemuxStream::FLAG_FORCED || !GetSubtitleVisible()) + if (ss.flags & CDemuxStream::FLAG_FORCED) { SelectionStream as = m_SelectionStreams.Get(STREAM_AUDIO, GetAudioStream()); - + bool found = false; for (const auto &stream : m_SelectionStreams.Get(STREAM_SUBTITLE)) { if (stream.flags & CDemuxStream::FLAG_FORCED && g_LangCodeExpander.CompareISO639Codes(stream.language, as.language)) { - if(OpenStream(m_CurrentSubtitle, stream.demuxerId, stream.id, stream.source)) + if (OpenStream(m_CurrentSubtitle, stream.demuxerId, stream.id, stream.source)) { - valid = true; + found = true; SetSubtitleVisibleInternal(true); break; } } } - if(!valid) + if (!found) { - CloseStream(m_CurrentSubtitle, true); SetSubtitleVisibleInternal(false); } } - return valid; } bool CVideoPlayer::OpenTeletextStream(CDVDStreamInfo& hint) diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.h b/xbmc/cores/VideoPlayer/VideoPlayer.h index e6cd2a8637..da02d907f5 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayer.h +++ b/xbmc/cores/VideoPlayer/VideoPlayer.h @@ -423,9 +423,8 @@ protected: /** \brief Switches forced subtitles to forced subtitles matching the language of the current audio track. * If these are not available, subtitles are disabled. - * \return true if the subtitles were changed, false otherwise. */ - bool AdaptForcedSubtitles(); + void AdaptForcedSubtitles(); bool CloseStream(CCurrentStream& current, bool bWaitForBuffers); bool CheckIsCurrent(CCurrentStream& current, CDemuxStream* stream, DemuxPacket* pkg); diff --git a/xbmc/cores/paplayer/PAPlayer.cpp b/xbmc/cores/paplayer/PAPlayer.cpp index 87c43a5553..780399f2dc 100644 --- a/xbmc/cores/paplayer/PAPlayer.cpp +++ b/xbmc/cores/paplayer/PAPlayer.cpp @@ -488,9 +488,11 @@ inline bool PAPlayer::PrepareStream(StreamInfo *si) si->m_stream->SetVolume (si->m_volume); float peak = 1.0; float gain = si->m_decoder.GetReplayGain(peak); - if (peak == 1.0) + if (peak * gain <= 1.0) + // No clipping protection needed si->m_stream->SetReplayGain(gain); else + // Clipping protecton provided as audio limiting si->m_stream->SetAmplification(gain); /* if its not the first stream and crossfade is not enabled */ diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp index 1c00edab33..91574029c2 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -279,7 +279,7 @@ void CAdvancedSettings::Initialize() m_strMusicLibraryAlbumFormat = ""; m_prioritiseAPEv2tags = false; m_musicItemSeparator = " / "; - m_musicArtistSeparators = { ";", ":", "|", " feat. ", " ft. " }; + m_musicArtistSeparators = { ";", " feat. ", " ft. " }; m_videoItemSeparator = " / "; m_iMusicLibraryDateAdded = 1; // prefer mtime over ctime and current time |