diff --git a/NEWS b/NEWS index 5de07ec3c..cf29cbad6 100644 --- a/NEWS +++ b/NEWS @@ -46,6 +46,15 @@ ver 0.24 (not yet released) * remove Boost dependency * require libfmt 7 or later +ver 0.23.14 (not yet released) +* decoder + - flac: fix scanning files with non-ASCII names on Windows + - mad: fix calculation of LAME peak values +* mixer + - wasapi: fix problem setting volume +* more libfmt 10 fixes +* fix auto-detected systemd unit directory + ver 0.23.13 (2023/05/22) * input - curl: fix busy loop after connection failed diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 68028d594..cbcc5f893 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="72" + android:versionName="0.23.14"> diff --git a/doc/mpdconf.example b/doc/mpdconf.example index 9d14bd642..4fc00dacd 100644 --- a/doc/mpdconf.example +++ b/doc/mpdconf.example @@ -314,6 +314,7 @@ input { ## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional # or ## device "0" # optional +## mixer_type "hardware" # optional ## Exclusive mode blocks all other audio source, and get best audio quality without resampling. ## exclusive "no" # optional ## Enumerate all devices in log. diff --git a/doc/user.rst b/doc/user.rst index 2206c3d1b..bf39aa19a 100644 --- a/doc/user.rst +++ b/doc/user.rst @@ -725,9 +725,11 @@ MPD enables MixRamp if: - Cross-fade is enabled - :ref:`mixrampdelay ` is set to a positive value, e.g.:: + mpc mixrampdelay 1 - :ref:`mixrampdb ` is set to a reasonable value, e.g.:: + mpc mixrampdb -17 - both songs have MixRamp tags (or ``mixramp_analyzer`` is enabled) - both songs have the same audio format (or :ref:`audio_output_format` diff --git a/python/build/libs.py b/python/build/libs.py index a1cef8a0e..c0fae9b9e 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -158,7 +158,7 @@ gme = CmakeProject( '-DBUILD_SHARED_LIBS=OFF', '-DENABLE_UBSAN=OFF', '-DZLIB_INCLUDE_DIR=OFF', - '-DSDL2_DIR=OFF', + '-DCMAKE_DISABLE_FIND_PACKAGE_SDL2=ON', ], ) diff --git a/src/decoder/plugins/FlacDecoderPlugin.cxx b/src/decoder/plugins/FlacDecoderPlugin.cxx index 7549722a3..a4ba22948 100644 --- a/src/decoder/plugins/FlacDecoderPlugin.cxx +++ b/src/decoder/plugins/FlacDecoderPlugin.cxx @@ -8,6 +8,7 @@ #include "lib/xiph/FlacMetadataChain.hxx" #include "OggCodec.hxx" #include "input/InputStream.hxx" +#include "input/LocalOpen.hxx" #include "fs/Path.hxx" #include "fs/NarrowPath.hxx" #include "Log.hxx" @@ -54,13 +55,30 @@ static bool flac_scan_file(Path path_fs, TagHandler &handler) noexcept { FlacMetadataChain chain; - if (!chain.Read(NarrowPath(path_fs))) { + const bool succeed = [&chain, &path_fs]() noexcept { + // read by NarrowPath + if (chain.Read(NarrowPath(path_fs))) { + return true; + } + if (std::is_same_v || + chain.GetStatus() != FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE) { + return false; + } + // read by InputStream + Mutex mutex; + auto is = OpenLocalInputStream(path_fs, mutex); + if (is && chain.Read(*is)) { + return true; + } + return false; + }(); + + if (!succeed) { FmtDebug(flac_domain, "Failed to read FLAC tags: {}", chain.GetStatusString()); return false; } - chain.Scan(handler); return true; } diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx index 4ed21a27f..f3687ef09 100644 --- a/src/decoder/plugins/MadDecoderPlugin.cxx +++ b/src/decoder/plugins/MadDecoderPlugin.cxx @@ -546,7 +546,21 @@ parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen) noexcept mad_bit_skip(ptr, 16); - lame->peak = MAD_F(mad_bit_read(ptr, 32) << 5); /* peak */ + /* The lame peak value is a float multiplied by 2^23 and stored as an + * unsigned integer (it is always positive). MAD's fixed-point format uses + * 28 bits for the fractional part, so shift the 23 bit fraction up before + * converting to a float. + */ + unsigned long peak_int = mad_bit_read(ptr, 32); + +#define LAME_PEAK_FRACBITS 23 +#if MAD_F_FRACBITS > LAME_PEAK_FRACBITS + peak_int <<= (MAD_F_FRACBITS - LAME_PEAK_FRACBITS); +#elif LAME_PEAK_FRACBITS > MAD_F_FRACBITS + peak_int >>= (LAME_PEAK_FRACBITS - MAD_F_FRACBITS); +#endif + + lame->peak = mad_f_todouble(peak_int); /* peak */ FmtDebug(mad_domain, "LAME peak found: {}", lame->peak); lame->track_gain = 0; diff --git a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx index c2a248724..af16c264d 100644 --- a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx +++ b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx @@ -1007,7 +1007,7 @@ WasapiOutput::EnumerateDevices(IMMDeviceEnumerator &enumerator) continue; FmtNotice(wasapi_output_domain, - "Device \"{}\" \"{}\"", i, name); + "Device \"{}\" \"{}\"", i, name.c_str()); } } diff --git a/src/thread/WindowsFuture.hxx b/src/thread/WindowsFuture.hxx index ed5672dc7..b7e123303 100644 --- a/src/thread/WindowsFuture.hxx +++ b/src/thread/WindowsFuture.hxx @@ -114,7 +114,7 @@ public: void set_value(const T &value) { std::unique_lock lock(mutex); - if (!std::holds_alternative(&result)) { + if (!std::holds_alternative(result)) { throw WinFutureError(WinFutureErrc::promise_already_satisfied); } result.template emplace(value); diff --git a/src/win32/ComWorker.hxx b/src/win32/ComWorker.hxx index 6e7306f3e..a51710b8e 100644 --- a/src/win32/ComWorker.hxx +++ b/src/win32/ComWorker.hxx @@ -40,17 +40,17 @@ public: using R = std::invoke_result_t>; auto promise = std::make_shared>(); auto future = promise->get_future(); - Push([function = std::forward(function), - promise = std::move(promise)]() mutable { + Push([func = std::forward(function), + prom = std::move(promise)]() mutable { try { if constexpr (std::is_void_v) { - std::invoke(std::forward(function)); - promise->set_value(); + std::invoke(std::forward(func)); + prom->set_value(); } else { - promise->set_value(std::invoke(std::forward(function))); + prom->set_value(std::invoke(std::forward(func))); } } catch (...) { - promise->set_exception(std::current_exception()); + prom->set_exception(std::current_exception()); } }); return future; diff --git a/systemd/system/meson.build b/systemd/system/meson.build index 632ff420e..c6d676b7c 100644 --- a/systemd/system/meson.build +++ b/systemd/system/meson.build @@ -4,7 +4,7 @@ if systemd_system_unit_dir == '' if systemd.found() systemd_system_unit_dir = systemd.get_variable( pkgconfig: 'systemdsystemunitdir', - pkgconfig_define: ['prefix', get_option('prefix')], + pkgconfig_define: ['rootprefix', get_option('prefix')], ) endif endif