From f44c67de0991d47765403e966dd43a0b0fe0aeef Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 5 Aug 2019 13:05:54 +0200 Subject: [PATCH 1/7] increment version number to 0.21.13 --- NEWS | 2 ++ android/AndroidManifest.xml | 4 ++-- doc/conf.py | 2 +- meson.build | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index daddfec74..fb4034a1f 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +ver 0.21.13 (not yet released) + ver 0.21.12 (2019/08/03) * decoder - mad: update bit rate after seeking diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 84455850c..9dc417f71 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="36" + android:versionName="0.21.13"> diff --git a/doc/conf.py b/doc/conf.py index f7ac8edfc..878f886b9 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -38,7 +38,7 @@ author = 'Max Kellermann' # built documents. # # The short X.Y version. -version = '0.21.12' +version = '0.21.13' # The full version, including alpha/beta/rc tags. release = version diff --git a/meson.build b/meson.build index 6d35c5990..0f00d4bbb 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'mpd', ['c', 'cpp'], - version: '0.21.12', + version: '0.21.13', meson_version: '>= 0.49.0', default_options: [ 'c_std=c99', From 864d6f312d30ea3ae145d901d245f90c8bd11185 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 5 Aug 2019 13:06:33 +0200 Subject: [PATCH 2/7] Revert "decoder/mad: use MAD_F_MIN and MAD_F_MAX" This reverts commit f7ed7446ae4be9226de554d6d75a14a9fb71dd7c. It was a bad idea, because MAD_F_MIN and MAD_F_MAX do not represent the clamping limits, but the theoretical minimum and maximum values of the mad_fixed_t data type. Closes https://github.com/MusicPlayerDaemon/MPD/issues/617 --- NEWS | 2 ++ src/decoder/plugins/MadDecoderPlugin.cxx | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index fb4034a1f..34b6c0a00 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.21.13 (not yet released) +* decoder + - mad: fix crackling sound (0.21.12 regression) ver 0.21.12 (2019/08/03) * decoder diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx index 1e357fd81..66cf8fb96 100644 --- a/src/decoder/plugins/MadDecoderPlugin.cxx +++ b/src/decoder/plugins/MadDecoderPlugin.cxx @@ -79,12 +79,14 @@ static inline int32_t mad_fixed_to_24_sample(mad_fixed_t sample) noexcept { static constexpr unsigned bits = 24; + static constexpr mad_fixed_t MIN = -MAD_F_ONE; + static constexpr mad_fixed_t MAX = MAD_F_ONE - 1; /* round */ sample = sample + (1L << (MAD_F_FRACBITS - bits)); /* quantize */ - return Clamp(sample, MAD_F_MIN, MAD_F_MAX) + return Clamp(sample, MIN, MAX) >> (MAD_F_FRACBITS + 1 - bits); } From 3ef043392c849f3042acc630942a35fa722a3943 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 6 Aug 2019 11:09:36 +0200 Subject: [PATCH 3/7] input/cdio_paranoia: drop support for libcdio-paranoia older than 10.2+0.93+1 Version 10.2+0.93+1 was released five years ago in 2014 and is the first version to feature cdio_cddap_free_messages(). There is no way to check the libcdio-paranoia version at compile time, so let's just remove support for older versions instead of attempting to fix the cdio_cddap_free_messages() check at build time. Closes https://github.com/MusicPlayerDaemon/MPD/issues/613 --- NEWS | 2 ++ src/input/plugins/CdioParanoiaInputPlugin.cxx | 4 ---- src/input/plugins/meson.build | 2 +- src/lib/cdio/Paranoia.hxx | 4 ---- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index 34b6c0a00..c4218b86d 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.21.13 (not yet released) +* input + - cdio_paranoia: require libcdio-paranoia 10.2+0.93+1 * decoder - mad: fix crackling sound (0.21.12 regression) diff --git a/src/input/plugins/CdioParanoiaInputPlugin.cxx b/src/input/plugins/CdioParanoiaInputPlugin.cxx index 2a96b6082..6b7630941 100644 --- a/src/input/plugins/CdioParanoiaInputPlugin.cxx +++ b/src/input/plugins/CdioParanoiaInputPlugin.cxx @@ -298,11 +298,7 @@ CdioParanoiaInputStream::Read(void *ptr, size_t length) if (s_err) { FormatError(cdio_domain, "paranoia_read: %s", s_err); -#if LIBCDIO_VERSION_NUM >= 90 cdio_cddap_free_messages(s_err); -#else - free(s_err); -#endif } throw; diff --git a/src/input/plugins/meson.build b/src/input/plugins/meson.build index 5fc2f122b..cf866a0ee 100644 --- a/src/input/plugins/meson.build +++ b/src/input/plugins/meson.build @@ -6,7 +6,7 @@ if alsa_dep.found() input_plugins_sources += 'AlsaInputPlugin.cxx' endif -libcdio_paranoia_dep = dependency('libcdio_paranoia', version: '>= 0.4', required: get_option('cdio_paranoia')) +libcdio_paranoia_dep = dependency('libcdio_paranoia', version: '>= 10.2+0.93+1', required: get_option('cdio_paranoia')) conf.set('ENABLE_CDIO_PARANOIA', libcdio_paranoia_dep.found()) if libcdio_paranoia_dep.found() input_plugins_sources += 'CdioParanoiaInputPlugin.cxx' diff --git a/src/lib/cdio/Paranoia.hxx b/src/lib/cdio/Paranoia.hxx index 19b4c4483..596d23666 100644 --- a/src/lib/cdio/Paranoia.hxx +++ b/src/lib/cdio/Paranoia.hxx @@ -34,11 +34,7 @@ #include "util/Compiler.h" #include -#if LIBCDIO_VERSION_NUM >= 90 #include -#else -#include -#endif #include #include From f6d0310f9c553f1e991c933512eb8d81a606344f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Aug 2019 06:34:43 +0200 Subject: [PATCH 4/7] output/jack: use SIZE_MAX instead of (size_t)-1 --- src/output/plugins/JackOutputPlugin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output/plugins/JackOutputPlugin.cxx b/src/output/plugins/JackOutputPlugin.cxx index 6b82b8bf7..5b7a2fe2e 100644 --- a/src/output/plugins/JackOutputPlugin.cxx +++ b/src/output/plugins/JackOutputPlugin.cxx @@ -602,7 +602,7 @@ JackOutput::WriteSamples(const float *src, size_t n_frames) const unsigned n_channels = audio_format.channels; float *dest[MAX_CHANNELS]; - size_t space = -1; + size_t space = SIZE_MAX; for (unsigned i = 0; i < n_channels; ++i) { jack_ringbuffer_data_t d[2]; jack_ringbuffer_get_write_vector(ringbuffer[i], d); From 848c63e2d55130c4e2ed3f3ef71ed9ea99a8bdba Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Aug 2019 20:24:51 +0200 Subject: [PATCH 5/7] output/jack: use std::atomic_bool for "shutdown" and "pause" Without this, the compiler may optimize accesses away. --- src/output/plugins/JackOutputPlugin.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/output/plugins/JackOutputPlugin.cxx b/src/output/plugins/JackOutputPlugin.cxx index 5b7a2fe2e..9204e9c1f 100644 --- a/src/output/plugins/JackOutputPlugin.cxx +++ b/src/output/plugins/JackOutputPlugin.cxx @@ -28,6 +28,8 @@ #include "util/Domain.hxx" #include "Log.hxx" +#include + #include #include @@ -69,13 +71,13 @@ struct JackOutput final : AudioOutput { jack_client_t *client; jack_ringbuffer_t *ringbuffer[MAX_PORTS]; - bool shutdown; + std::atomic_bool shutdown; /** * While this flag is set, the "process" callback generates * silence. */ - bool pause; + std::atomic_bool pause; explicit JackOutput(const ConfigBlock &block); From bcccc8f66c8e7f320828b585af487fabba004b19 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 5 Aug 2019 09:35:41 +0200 Subject: [PATCH 6/7] output/jack: use jack_free() for Windows compatibility --- NEWS | 2 ++ src/output/plugins/JackOutputPlugin.cxx | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index c4218b86d..3bb42ed36 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ ver 0.21.13 (not yet released) - cdio_paranoia: require libcdio-paranoia 10.2+0.93+1 * decoder - mad: fix crackling sound (0.21.12 regression) +* output + - jack: improved Windows compatibility ver 0.21.12 (2019/08/03) * decoder diff --git a/src/output/plugins/JackOutputPlugin.cxx b/src/output/plugins/JackOutputPlugin.cxx index 9204e9c1f..900c2baaf 100644 --- a/src/output/plugins/JackOutputPlugin.cxx +++ b/src/output/plugins/JackOutputPlugin.cxx @@ -531,7 +531,10 @@ JackOutput::Start() jports = nullptr; } - AtScopeExit(jports) { free(jports); }; + AtScopeExit(jports) { + if (jports != nullptr) + jack_free(jports); + }; assert(num_dports > 0); From d4d2bc072e2d05c284975c049eb52a8fcb044fd8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 6 Aug 2019 11:35:42 +0200 Subject: [PATCH 7/7] release v0.21.13 --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 3bb42ed36..157fd861a 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ver 0.21.13 (not yet released) +ver 0.21.13 (2019/08/06) * input - cdio_paranoia: require libcdio-paranoia 10.2+0.93+1 * decoder