From e70f40fac1f743d0a7df7544a348fb2e24c3a541 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 22 Aug 2019 11:40:17 +0200 Subject: [PATCH 01/16] increment version number to 0.21.15 --- 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 fa91b1444..bfbd0acbe 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +ver 0.21.15 (not yet released) + ver 0.21.14 (2019/08/21) * decoder - sidplay: show track durations in database diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index dbf63165a..282707c61 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="38" + android:versionName="0.21.15"> diff --git a/doc/conf.py b/doc/conf.py index 71294b46b..196a52719 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.14' +version = '0.21.15' # The full version, including alpha/beta/rc tags. release = version diff --git a/meson.build b/meson.build index 842c074f3..602bf23f6 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'mpd', ['c', 'cpp'], - version: '0.21.14', + version: '0.21.15', meson_version: '>= 0.49.0', default_options: [ 'c_std=c99', From 818b7e0641f25f55c46bf654d8edb7911c10d584 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 22 Aug 2019 11:41:12 +0200 Subject: [PATCH 02/16] output/solaris: include sys/stropts.h only on Solaris This header had been available for a long time on Linux, but was removed in glibc 2.30. This commit moves the `#include` line inside the `#ifdef __sun` block and adds a fake declaration of `I_FLUSH` for the Linux build. Closes https://github.com/MusicPlayerDaemon/MPD/issues/630 --- src/output/plugins/SolarisOutputPlugin.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/output/plugins/SolarisOutputPlugin.cxx b/src/output/plugins/SolarisOutputPlugin.cxx index bb7cc56d6..d6323d5aa 100644 --- a/src/output/plugins/SolarisOutputPlugin.cxx +++ b/src/output/plugins/SolarisOutputPlugin.cxx @@ -22,7 +22,6 @@ #include "system/FileDescriptor.hxx" #include "system/Error.hxx" -#include #include #include #include @@ -31,11 +30,18 @@ #ifdef __sun #include +#include #else /* some fake declarations that allow build this plugin on systems other than Solaris, just to see if it compiles */ +#include + +#ifndef I_FLUSH +#define I_FLUSH 0 +#endif + #define AUDIO_GETINFO 0 #define AUDIO_SETINFO 0 #define AUDIO_ENCODING_LINEAR 0 From 8cf50b08f29aa33c4fa402bc420d9703a68e8be8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 1 Sep 2019 12:58:26 +0200 Subject: [PATCH 03/16] python/build/libs: update libogg to 1.3.4 --- python/build/libs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/build/libs.py b/python/build/libs.py index 103c67b09..ea2585dd7 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -15,8 +15,8 @@ libmpdclient = MesonProject( ) libogg = AutotoolsProject( - 'http://downloads.xiph.org/releases/ogg/libogg-1.3.3.tar.xz', - '4f3fc6178a533d392064f14776b23c397ed4b9f48f5de297aba73b643f955c08', + 'http://downloads.xiph.org/releases/ogg/libogg-1.3.4.tar.xz', + 'c163bc12bc300c401b6aa35907ac682671ea376f13ae0969a220f7ddf71893fe', 'lib/libogg.a', [ '--disable-shared', '--enable-static', From 28a441c9771eed2c0fcefbab345f5882a573b6df Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 1 Sep 2019 12:59:17 +0200 Subject: [PATCH 04/16] python/build/libs: update Opus to 1.3.1 --- python/build/libs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/build/libs.py b/python/build/libs.py index ea2585dd7..3ef34dea5 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -38,8 +38,8 @@ libvorbis = AutotoolsProject( ) opus = AutotoolsProject( - 'https://archive.mozilla.org/pub/opus/opus-1.3.tar.gz', - '4f3d69aefdf2dbaf9825408e452a8a414ffc60494c70633560700398820dc550', + 'https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz', + '65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d', 'lib/libopus.a', [ '--disable-shared', '--enable-static', From 8f8ed8732783119008cbc3d3c6f0f8e2831e6d71 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 1 Sep 2019 13:00:26 +0200 Subject: [PATCH 05/16] python/build/libs: update FFmpeg to 4.2 --- python/build/libs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/build/libs.py b/python/build/libs.py index 3ef34dea5..b083984e2 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -112,8 +112,8 @@ liblame = AutotoolsProject( ) ffmpeg = FfmpegProject( - 'http://ffmpeg.org/releases/ffmpeg-4.1.3.tar.xz', - '0c3020452880581a8face91595b239198078645e7d7184273b8bcc7758beb63d', + 'http://ffmpeg.org/releases/ffmpeg-4.2.tar.xz', + '023f10831a97ad93d798f53a3640e55cd564abfeba807ecbe8524dac4fedecd5', 'lib/libavcodec.a', [ '--disable-shared', '--enable-static', From 4d1720c886f4f3ae6fe998502f27790aab02d5b0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 1 Sep 2019 13:02:04 +0200 Subject: [PATCH 06/16] python/build/libs: update CURL to 7.65.3 --- python/build/libs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/build/libs.py b/python/build/libs.py index b083984e2..7b98c4930 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -341,8 +341,8 @@ ffmpeg = FfmpegProject( ) curl = AutotoolsProject( - 'http://curl.haxx.se/download/curl-7.64.1.tar.xz', - '9252332a7f871ce37bfa7f78bdd0a0e3924d8187cc27cb57c76c9474a7168fb3', + 'http://curl.haxx.se/download/curl-7.65.3.tar.xz', + 'f2d98854813948d157f6a91236ae34ca4a1b4cb302617cebad263d79b0235fea', 'lib/libcurl.a', [ '--disable-shared', '--enable-static', From 928bee933db20b1be65d5f434dce009523f9abae Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 1 Sep 2019 13:02:56 +0200 Subject: [PATCH 07/16] python/build/libs: update expat to 2.2.7 --- python/build/libs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/build/libs.py b/python/build/libs.py index 7b98c4930..270765fec 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -365,8 +365,8 @@ curl = AutotoolsProject( ) libexpat = AutotoolsProject( - 'https://github.com/libexpat/libexpat/releases/download/R_2_2_6/expat-2.2.6.tar.bz2', - '17b43c2716d521369f82fc2dc70f359860e90fa440bea65b3b85f0b246ea81f2', + 'https://github.com/libexpat/libexpat/releases/download/R_2_2_7/expat-2.2.7.tar.bz2', + 'cbc9102f4a31a8dafd42d642e9a3aa31e79a0aedaa1f6efd2795ebc83174ec18', 'lib/libexpat.a', [ '--disable-shared', '--enable-static', From 193e637dd9516d0c1d2236ace511eba8971d30ef Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 1 Sep 2019 13:03:50 +0200 Subject: [PATCH 08/16] python/build/libs: update Boost to 1.71.0 --- python/build/libs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/build/libs.py b/python/build/libs.py index 270765fec..bf45eb573 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -392,7 +392,7 @@ libnfs = AutotoolsProject( ) boost = BoostProject( - 'http://downloads.sourceforge.net/project/boost/boost/1.70.0/boost_1_70_0.tar.bz2', - '430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778', + 'https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.bz2', + 'd73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee', 'include/boost/version.hpp', ) From 0da9c91af263706009c99086059cd3eec8de62d2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 8 Sep 2019 12:45:05 +0200 Subject: [PATCH 09/16] decoder/{dsf,dsdiff}: fix displayed bit rate The formula did not consider the channel count. Closes https://github.com/MusicPlayerDaemon/MPD/issues/639 --- NEWS | 2 ++ src/decoder/plugins/DsdiffDecoderPlugin.cxx | 2 +- src/decoder/plugins/DsfDecoderPlugin.cxx | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index bfbd0acbe..48489ab41 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.21.15 (not yet released) +* decoder + - dsdiff, dsf: fix displayed bit rate ver 0.21.14 (2019/08/21) * decoder diff --git a/src/decoder/plugins/DsdiffDecoderPlugin.cxx b/src/decoder/plugins/DsdiffDecoderPlugin.cxx index e601c6ebd..8c76227eb 100644 --- a/src/decoder/plugins/DsdiffDecoderPlugin.cxx +++ b/src/decoder/plugins/DsdiffDecoderPlugin.cxx @@ -408,7 +408,7 @@ dsdiff_decode_chunk(DecoderClient &client, InputStream &is, bit_reverse_buffer(buffer, buffer + nbytes); cmd = client.SubmitData(is, buffer, nbytes, - sample_rate / 1000); + channels * sample_rate / 1000); } return true; diff --git a/src/decoder/plugins/DsfDecoderPlugin.cxx b/src/decoder/plugins/DsfDecoderPlugin.cxx index e040d449c..a019ee5c3 100644 --- a/src/decoder/plugins/DsfDecoderPlugin.cxx +++ b/src/decoder/plugins/DsfDecoderPlugin.cxx @@ -291,7 +291,7 @@ dsf_decode_chunk(DecoderClient &client, InputStream &is, cmd = client.SubmitData(is, interleaved_buffer, block_size, - sample_rate / 1000); + channels * sample_rate / 1000); ++i; } From bf49c9e4e2ad6c43034774b928b8fdab090223e3 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 8 Sep 2019 12:52:02 +0200 Subject: [PATCH 10/16] decoder/{dsf,dsdiff}: precalculate bit rate --- src/decoder/plugins/DsdiffDecoderPlugin.cxx | 3 ++- src/decoder/plugins/DsfDecoderPlugin.cxx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/decoder/plugins/DsdiffDecoderPlugin.cxx b/src/decoder/plugins/DsdiffDecoderPlugin.cxx index 8c76227eb..b1779632a 100644 --- a/src/decoder/plugins/DsdiffDecoderPlugin.cxx +++ b/src/decoder/plugins/DsdiffDecoderPlugin.cxx @@ -362,6 +362,7 @@ dsdiff_decode_chunk(DecoderClient &client, InputStream &is, unsigned channels, unsigned sample_rate, const offset_type total_bytes) { + const unsigned kbit_rate = channels * sample_rate / 1000; const offset_type start_offset = is.GetOffset(); uint8_t buffer[8192]; @@ -408,7 +409,7 @@ dsdiff_decode_chunk(DecoderClient &client, InputStream &is, bit_reverse_buffer(buffer, buffer + nbytes); cmd = client.SubmitData(is, buffer, nbytes, - channels * sample_rate / 1000); + kbit_rate); } return true; diff --git a/src/decoder/plugins/DsfDecoderPlugin.cxx b/src/decoder/plugins/DsfDecoderPlugin.cxx index a019ee5c3..332f0525c 100644 --- a/src/decoder/plugins/DsfDecoderPlugin.cxx +++ b/src/decoder/plugins/DsfDecoderPlugin.cxx @@ -256,6 +256,7 @@ dsf_decode_chunk(DecoderClient &client, InputStream &is, offset_type n_blocks, bool bitreverse) { + const unsigned kbit_rate = channels * sample_rate / 1000; const size_t block_size = channels * DSF_BLOCK_SIZE; const offset_type start_offset = is.GetOffset(); @@ -291,7 +292,7 @@ dsf_decode_chunk(DecoderClient &client, InputStream &is, cmd = client.SubmitData(is, interleaved_buffer, block_size, - channels * sample_rate / 1000); + kbit_rate); ++i; } From 5ef645df97b72263adc5b17059bde13c0b1f1b2e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 8 Sep 2019 12:54:16 +0200 Subject: [PATCH 11/16] NEWS: add missing line for 818b7e0641f25f --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 48489ab41..057dba43c 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ ver 0.21.15 (not yet released) * decoder - dsdiff, dsf: fix displayed bit rate +* output + - solaris: fix build with glibc 2.30 ver 0.21.14 (2019/08/21) * decoder From 496f88653d9166338d37fb94cc10cffd6af196d5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 13 Sep 2019 19:46:39 +0200 Subject: [PATCH 12/16] ReplayGainInfo: add static method Undefined() --- src/ReplayGainInfo.hxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ReplayGainInfo.hxx b/src/ReplayGainInfo.hxx index b2664abc3..685bfe9a0 100644 --- a/src/ReplayGainInfo.hxx +++ b/src/ReplayGainInfo.hxx @@ -38,6 +38,10 @@ struct ReplayGainTuple { return gain > -100; } + static constexpr ReplayGainTuple Undefined() noexcept { + return {-200.0f, 0.0f}; + } + gcc_pure float CalculateScale(const ReplayGainConfig &config) const noexcept; }; @@ -49,6 +53,13 @@ struct ReplayGainInfo { return track.IsDefined() || album.IsDefined(); } + static constexpr ReplayGainInfo Undefined() noexcept { + return { + ReplayGainTuple::Undefined(), + ReplayGainTuple::Undefined(), + }; + } + const ReplayGainTuple &Get(ReplayGainMode mode) const noexcept { return mode == ReplayGainMode::ALBUM ? (album.IsDefined() ? album : track) From b6243a99450fcef7cd3a1bdea628a93719c1fc5f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 13 Sep 2019 19:45:26 +0200 Subject: [PATCH 13/16] decoder/mpcdec: merge duplicate code --- src/decoder/plugins/MpcdecDecoderPlugin.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/decoder/plugins/MpcdecDecoderPlugin.cxx b/src/decoder/plugins/MpcdecDecoderPlugin.cxx index 76c71a1ed..b7be3fd8e 100644 --- a/src/decoder/plugins/MpcdecDecoderPlugin.cxx +++ b/src/decoder/plugins/MpcdecDecoderPlugin.cxx @@ -137,6 +137,15 @@ mpc_to_mpd_buffer(MpcdecSampleTraits::pointer_type dest, *dest++ = mpc_to_mpd_sample(*src++); } +static constexpr ReplayGainTuple +ImportMpcdecReplayGain(mpc_uint16_t gain, mpc_uint16_t peak) noexcept +{ + auto t = ReplayGainTuple::Undefined(); + t.gain = MPC_OLD_GAIN_REF - (gain / 256.); + t.peak = pow(10, peak / 256. / 20) / 32767; + return t; +} + static void mpcdec_decode(DecoderClient &client, InputStream &is) { @@ -169,10 +178,8 @@ mpcdec_decode(DecoderClient &client, InputStream &is) ReplayGainInfo rgi; rgi.Clear(); - rgi.album.gain = MPC_OLD_GAIN_REF - (info.gain_album / 256.); - rgi.album.peak = pow(10, info.peak_album / 256. / 20) / 32767; - rgi.track.gain = MPC_OLD_GAIN_REF - (info.gain_title / 256.); - rgi.track.peak = pow(10, info.peak_title / 256. / 20) / 32767; + rgi.album = ImportMpcdecReplayGain(info.gain_album, info.peak_album); + rgi.track = ImportMpcdecReplayGain(info.gain_title, info.peak_title); client.SubmitReplayGain(&rgi); From 9270829b5b8c02e2e3dba1d3cc41d983616f68d1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 13 Sep 2019 19:49:41 +0200 Subject: [PATCH 14/16] ReplayGainInfo: move more code to a function --- src/decoder/plugins/MpcdecDecoderPlugin.cxx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/decoder/plugins/MpcdecDecoderPlugin.cxx b/src/decoder/plugins/MpcdecDecoderPlugin.cxx index b7be3fd8e..f7f0870fd 100644 --- a/src/decoder/plugins/MpcdecDecoderPlugin.cxx +++ b/src/decoder/plugins/MpcdecDecoderPlugin.cxx @@ -146,6 +146,15 @@ ImportMpcdecReplayGain(mpc_uint16_t gain, mpc_uint16_t peak) noexcept return t; } +static constexpr ReplayGainInfo +ImportMpcdecReplayGain(const mpc_streaminfo &info) noexcept +{ + auto rgi = ReplayGainInfo::Undefined(); + rgi.album = ImportMpcdecReplayGain(info.gain_album, info.peak_album); + rgi.track = ImportMpcdecReplayGain(info.gain_title, info.peak_title); + return rgi; +} + static void mpcdec_decode(DecoderClient &client, InputStream &is) { @@ -176,12 +185,10 @@ mpcdec_decode(DecoderClient &client, InputStream &is) mpcdec_sample_format, info.channels); - ReplayGainInfo rgi; - rgi.Clear(); - rgi.album = ImportMpcdecReplayGain(info.gain_album, info.peak_album); - rgi.track = ImportMpcdecReplayGain(info.gain_title, info.peak_title); - - client.SubmitReplayGain(&rgi); + { + const auto rgi = ImportMpcdecReplayGain(info); + client.SubmitReplayGain(&rgi); + } client.Ready(audio_format, is.IsSeekable(), SongTime::FromS(mpc_streaminfo_get_length(&info))); From 92495d2b0b33a1088e41f03597ba4ad596ae4e50 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 13 Sep 2019 19:41:54 +0200 Subject: [PATCH 15/16] decoder/mpcdec: fix bogus ReplayGain values Apparently, libmpcdec sets gain/peak variables to zero if they are not present. This clashes with our formula and results in bogus values which cause noise during playback. Closes https://github.com/MusicPlayerDaemon/MPD/issues/640 --- NEWS | 1 + src/decoder/plugins/MpcdecDecoderPlugin.cxx | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 057dba43c..a509c8e13 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ver 0.21.15 (not yet released) * decoder - dsdiff, dsf: fix displayed bit rate + - mpcdec: fix bogus ReplayGain values * output - solaris: fix build with glibc 2.30 diff --git a/src/decoder/plugins/MpcdecDecoderPlugin.cxx b/src/decoder/plugins/MpcdecDecoderPlugin.cxx index f7f0870fd..68ecc115d 100644 --- a/src/decoder/plugins/MpcdecDecoderPlugin.cxx +++ b/src/decoder/plugins/MpcdecDecoderPlugin.cxx @@ -141,8 +141,12 @@ static constexpr ReplayGainTuple ImportMpcdecReplayGain(mpc_uint16_t gain, mpc_uint16_t peak) noexcept { auto t = ReplayGainTuple::Undefined(); - t.gain = MPC_OLD_GAIN_REF - (gain / 256.); - t.peak = pow(10, peak / 256. / 20) / 32767; + + if (gain != 0 && peak != 0) { + t.gain = MPC_OLD_GAIN_REF - (gain / 256.); + t.peak = pow(10, peak / 256. / 20) / 32767; + } + return t; } @@ -187,7 +191,8 @@ mpcdec_decode(DecoderClient &client, InputStream &is) { const auto rgi = ImportMpcdecReplayGain(info); - client.SubmitReplayGain(&rgi); + if (rgi.IsDefined()) + client.SubmitReplayGain(&rgi); } client.Ready(audio_format, is.IsSeekable(), From 964804a4c2cdd65f2bf08b3bfde063e0c126fd4c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 25 Sep 2019 21:24:15 +0200 Subject: [PATCH 16/16] release v0.21.15 --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index a509c8e13..96fd78924 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ver 0.21.15 (not yet released) +ver 0.21.15 (2019/09/25) * decoder - dsdiff, dsf: fix displayed bit rate - mpcdec: fix bogus ReplayGain values