From 5834843b8ad3ccc6088d0126a171ffd4a721e03c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 2 Aug 2016 19:15:23 +0200 Subject: [PATCH 1/5] decoder/ffmpeg: fix the AVCodecParameters API check Turns out the libavcodec version numbers are not linear; the feature was added in FFmpeg 3.1 commit 998e1b8, libavcodec 57.14.0; but FFmpeg 3.0 has version 57.48.101. Ouch! --- src/decoder/plugins/FfmpegDecoderPlugin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 0b85122f0..7695dcb4f 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -86,7 +86,7 @@ ffmpeg_init(gcc_unused const config_param ¶m) return true; } -#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 5, 0) +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 25, 0) /* FFmpeg 3.1 */ gcc_pure static const AVCodecParameters & From 36704c5e1868e15e4b2c0b684f99bde6c137e1b3 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 5 Aug 2016 17:48:53 +0200 Subject: [PATCH 2/5] Makefile.am: fix "undefined reference" linker error --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index 34dcabd73..744b96603 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1876,6 +1876,7 @@ test_run_convert_SOURCES = test/run_convert.cxx \ src/AudioParser.cxx test_run_convert_LDADD = \ $(PCM_LIBS) \ + libconf.a \ libutil.a \ $(GLIB_LIBS) From 588303b78def99b851284d46f155c9f8fae67329 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 5 Aug 2016 18:06:07 +0200 Subject: [PATCH 3/5] lib/nfs/Manager: add Compare(ManagedConnection, ManagedConnection) Required for Boost 1.61, which uses that overload in a BOOST_ASSERT(). --- NEWS | 1 + src/lib/nfs/Manager.cxx | 12 ++++++++++++ src/lib/nfs/Manager.hxx | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/NEWS b/NEWS index d47e97a48..e56ccc394 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ ver 0.19.18 (not yet released) - sidplay: allow building with libsidplayfp instead of libsidplay2 * output - shout: recognize setting "encoder" instead of "encoding" +* fix build failure with Boost 1.61 * require gcc 4.7 or newer ver 0.19.17 (2016/07/09) diff --git a/src/lib/nfs/Manager.cxx b/src/lib/nfs/Manager.cxx index 6d50cce18..2164b1d07 100644 --- a/src/lib/nfs/Manager.cxx +++ b/src/lib/nfs/Manager.cxx @@ -59,6 +59,18 @@ NfsManager::Compare::operator()(const ManagedConnection &a, return result < 0; } +inline bool +NfsManager::Compare::operator()(const ManagedConnection &a, + const ManagedConnection &b) const +{ + int result = strcmp(a.GetServer(), b.GetServer()); + if (result != 0) + return result < 0; + + result = strcmp(a.GetExportName(), b.GetExportName()); + return result < 0; +} + NfsManager::~NfsManager() { assert(GetEventLoop().IsInside()); diff --git a/src/lib/nfs/Manager.hxx b/src/lib/nfs/Manager.hxx index 130c81aca..80acbdfc9 100644 --- a/src/lib/nfs/Manager.hxx +++ b/src/lib/nfs/Manager.hxx @@ -64,6 +64,10 @@ class NfsManager final : IdleMonitor { gcc_pure bool operator()(const ManagedConnection &a, const LookupKey b) const; + + gcc_pure + bool operator()(const ManagedConnection &a, + const ManagedConnection &b) const; }; /** From d042ab87da4aad4a742189437a3293ee7e516203 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 5 Aug 2016 18:15:30 +0200 Subject: [PATCH 4/5] decoder/Thread: delete the InputStream on error Fixes memory leak after stream failure. See https://bugs.musicpd.org/view.php?id=4562 --- NEWS | 1 + src/decoder/DecoderThread.cxx | 1 + 2 files changed, 2 insertions(+) diff --git a/NEWS b/NEWS index e56ccc394..452e9b726 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ ver 0.19.18 (not yet released) - sidplay: allow building with libsidplayfp instead of libsidplay2 * output - shout: recognize setting "encoder" instead of "encoding" +* fix memory leak after stream failure * fix build failure with Boost 1.61 * require gcc 4.7 or newer diff --git a/src/decoder/DecoderThread.cxx b/src/decoder/DecoderThread.cxx index d5f73c3e3..2e407e6ff 100644 --- a/src/decoder/DecoderThread.cxx +++ b/src/decoder/DecoderThread.cxx @@ -98,6 +98,7 @@ decoder_input_stream_open(DecoderControl &dc, const char *uri) if (!is->Check(error)) { dc.Unlock(); + delete is; LogError(error); return nullptr; From 2b97b124bd3cdcfcc70fa4fef184a3ee4118e423 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 5 Aug 2016 18:45:23 +0200 Subject: [PATCH 5/5] release v0.19.18 --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 452e9b726..f49028293 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ver 0.19.18 (not yet released) +ver 0.19.18 (2016/08/05) * decoder - ffmpeg: fix crash with older FFmpeg versions (< 3.0) - ffmpeg: log detailed error message