From f6f30d6d64946eda043bce2c7025ef8c5074444f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 25 Jan 2020 20:06:58 +0100 Subject: [PATCH 01/12] increment version number to 0.21.20 --- 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 3a7acd6cc..e06a66fea 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +ver 0.21.20 (not yet released) + ver 0.21.19 (2020/01/17) * configuration - allow overriding top-level settings in includes diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 25c755885..a7ea8a550 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="43" + android:versionName="0.21.20"> diff --git a/doc/conf.py b/doc/conf.py index 20398af20..836c2b58c 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.19' +version = '0.21.20' # The full version, including alpha/beta/rc tags. release = version diff --git a/meson.build b/meson.build index 4acd0db64..49bb534c9 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'mpd', ['c', 'cpp'], - version: '0.21.19', + version: '0.21.20', meson_version: '>= 0.49.0', default_options: [ 'c_std=c99', From 54d57fdcc26cd6ada7c7ec6704ed3a106f9720ce Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 25 Jan 2020 19:24:43 +0100 Subject: [PATCH 02/12] test/DumpDecoderClient: dump the `seekable` flag --- test/DumpDecoderClient.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/DumpDecoderClient.cxx b/test/DumpDecoderClient.cxx index a876c7ad7..c0c5dd92a 100644 --- a/test/DumpDecoderClient.cxx +++ b/test/DumpDecoderClient.cxx @@ -28,15 +28,15 @@ void DumpDecoderClient::Ready(const AudioFormat audio_format, - gcc_unused bool seekable, + bool seekable, SignedSongTime duration) { assert(!initialized); assert(audio_format.IsValid()); - fprintf(stderr, "audio_format=%s duration=%f\n", + fprintf(stderr, "audio_format=%s duration=%f seekable=%d\n", ToString(audio_format).c_str(), - duration.ToDoubleS()); + duration.ToDoubleS(), seekable); initialized = true; } From 881d91f86b25c501e5cf5140da5b5602ddb8227f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 25 Jan 2020 20:03:18 +0100 Subject: [PATCH 03/12] lib/xiph/OggFind: add parameter "synced" --- src/lib/xiph/OggFind.cxx | 5 +++-- src/lib/xiph/OggFind.hxx | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/xiph/OggFind.cxx b/src/lib/xiph/OggFind.cxx index e31bd9514..583d5fad0 100644 --- a/src/lib/xiph/OggFind.cxx +++ b/src/lib/xiph/OggFind.cxx @@ -57,13 +57,14 @@ OggSeekPageAtOffset(OggSyncState &oy, ogg_stream_state &os, InputStream &is, bool OggSeekFindEOS(OggSyncState &oy, ogg_stream_state &os, ogg_packet &packet, - InputStream &is) + InputStream &is, bool synced) { if (!is.KnownSize()) return false; if (is.GetRest() < 65536) - return OggFindEOS(oy, os, packet); + return (synced || oy.ExpectPageSeekIn(os)) && + OggFindEOS(oy, os, packet); if (!is.CheapSeeking()) return false; diff --git a/src/lib/xiph/OggFind.hxx b/src/lib/xiph/OggFind.hxx index 051237900..a8ddf60f3 100644 --- a/src/lib/xiph/OggFind.hxx +++ b/src/lib/xiph/OggFind.hxx @@ -47,10 +47,13 @@ OggSeekPageAtOffset(OggSyncState &oy, ogg_stream_state &os, InputStream &is, * Try to find the end-of-stream (EOS) packet. Seek to the end of the * file if necessary. * + * @param synced is the #OggSyncState currently synced? If not, then + * we need to use ogg_sync_pageseek() instead of ogg_sync_pageout(), + * which is more expensive * @return true if the EOS packet was found */ bool OggSeekFindEOS(OggSyncState &oy, ogg_stream_state &os, ogg_packet &packet, - InputStream &is); + InputStream &is, bool synced=true); #endif From 943a67c805479f14f6843ced8897a583b433f8a1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 25 Jan 2020 20:04:22 +0100 Subject: [PATCH 04/12] decoder/ogg: need to sync small files while looking for EOS When calling OggSeekFindEOS() from inside a OggVisitor callback, then the #InputStream may be in the middle of an Ogg packet, and the newly initialized #ogg_sync_state will not be able to load it without the help of ogg_sync_pageseek(). By passing "synced=false" to OggSeekFindEOS(), we force the use of ogg_sync_pageseek() even when not actually seeking. Closes https://github.com/MusicPlayerDaemon/MPD/issues/719 --- src/decoder/plugins/OggDecoder.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/decoder/plugins/OggDecoder.cxx b/src/decoder/plugins/OggDecoder.cxx index 059b1488f..c1caf59d7 100644 --- a/src/decoder/plugins/OggDecoder.cxx +++ b/src/decoder/plugins/OggDecoder.cxx @@ -47,8 +47,12 @@ OggDecoder::LoadEndPacket(ogg_packet &packet) const DecoderReader reader(client, input_stream); OggSyncState sync2(reader); OggStreamState stream2(GetSerialNo()); + + /* passing synced=false because we're inside an + OggVisitor callback, and our InputStream may be in + the middle of an Ogg packet */ result = OggSeekFindEOS(sync2, stream2, packet, - input_stream); + input_stream, false); } /* restore the previous file position */ From 0c9e25b3c40b24e01a993daa5cf8bdb9ac30e034 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 25 Jan 2020 20:09:16 +0100 Subject: [PATCH 05/12] NEWS: add missing line --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index e06a66fea..e2f0d4288 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.21.20 (not yet released) +* decoder + - vorbis, opus: fix seeking in small files ver 0.21.19 (2020/01/17) * configuration From 80a0cf694f152f94488b9c5cf2bd35518f149f73 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 30 Jan 2020 21:53:50 -0800 Subject: [PATCH 06/12] MadDecoderPlugin: fix bad printf format max_frames is size_t, not unsigned long. Fixes GCC warning. --- src/decoder/plugins/MadDecoderPlugin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx index 649cca78c..b21f7cba9 100644 --- a/src/decoder/plugins/MadDecoderPlugin.cxx +++ b/src/decoder/plugins/MadDecoderPlugin.cxx @@ -793,7 +793,7 @@ MadDecoder::DecodeFirstFrame(Tag *tag) noexcept if (max_frames > 8 * 1024 * 1024) { FormatWarning(mad_domain, - "mp3 file header indicates too many frames: %lu", + "mp3 file header indicates too many frames: %zu", max_frames); return false; } From 0bb943ba3efb4344332de25eb5ee506257557802 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 31 Jan 2020 17:49:31 -0800 Subject: [PATCH 07/12] FfmpegDecoderPlugin: add WAV support --- NEWS | 1 + src/decoder/plugins/FfmpegDecoderPlugin.cxx | 1 + 2 files changed, 2 insertions(+) diff --git a/NEWS b/NEWS index e2f0d4288..acf2f70b5 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ ver 0.21.20 (not yet released) * decoder + - ffmpeg: handle MIME type "audio/wav" - vorbis, opus: fix seeking in small files ver 0.21.19 (2020/01/17) diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 3bd0ecad5..31910470f 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -775,6 +775,7 @@ static const char *const ffmpeg_mime_types[] = { "audio/qcelp", "audio/vorbis", "audio/vorbis+ogg", + "audio/wav", "audio/x-8svx", "audio/x-16sv", "audio/x-aac", From 5ad6e7fec5271f173816a2ca83559d0407032c14 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 1 Feb 2020 11:26:57 +0100 Subject: [PATCH 08/12] decoder/{audio,snd}file: handle MIME type "audio/wav" --- NEWS | 2 +- src/decoder/plugins/AudiofileDecoderPlugin.cxx | 2 ++ src/decoder/plugins/SndfileDecoderPlugin.cxx | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index acf2f70b5..357e739eb 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ ver 0.21.20 (not yet released) * decoder - - ffmpeg: handle MIME type "audio/wav" + - audiofile, ffmpeg, sndfile: handle MIME type "audio/wav" - vorbis, opus: fix seeking in small files ver 0.21.19 (2020/01/17) diff --git a/src/decoder/plugins/AudiofileDecoderPlugin.cxx b/src/decoder/plugins/AudiofileDecoderPlugin.cxx index 8ebc68ca4..3ecfb4bba 100644 --- a/src/decoder/plugins/AudiofileDecoderPlugin.cxx +++ b/src/decoder/plugins/AudiofileDecoderPlugin.cxx @@ -269,6 +269,8 @@ static const char *const audiofile_suffixes[] = { }; static const char *const audiofile_mime_types[] = { + "audio/wav", + "audio/aiff", "audio/x-wav", "audio/x-aiff", nullptr diff --git a/src/decoder/plugins/SndfileDecoderPlugin.cxx b/src/decoder/plugins/SndfileDecoderPlugin.cxx index 08cbb88c1..de0f45112 100644 --- a/src/decoder/plugins/SndfileDecoderPlugin.cxx +++ b/src/decoder/plugins/SndfileDecoderPlugin.cxx @@ -322,6 +322,8 @@ static const char *const sndfile_suffixes[] = { }; static const char *const sndfile_mime_types[] = { + "audio/wav", + "audio/aiff", "audio/x-wav", "audio/x-aiff", From 0914644d2b9d380587762bb2acfc7d3fa6c32704 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 2 Feb 2020 16:08:36 -0800 Subject: [PATCH 09/12] add missing comma Found with bugprone-suspicious-missing-comma Signed-off-by: Rosen Penev --- 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 31910470f..0ec77c6f8 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -762,7 +762,7 @@ static const char *const ffmpeg_mime_types[] = { "audio/aac", "audio/aacp", "audio/ac3", - "audio/aiff" + "audio/aiff", "audio/amr", "audio/basic", "audio/flac", From 50003f6ad2465c0612594ec5635da73096e7d7cf Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 4 Feb 2020 16:30:05 +0100 Subject: [PATCH 10/12] decoder/ffmpeg: add two more missing commas --- NEWS | 1 + src/decoder/plugins/FfmpegDecoderPlugin.cxx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 357e739eb..32a4eed6e 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ver 0.21.20 (not yet released) * decoder - audiofile, ffmpeg, sndfile: handle MIME type "audio/wav" + - ffmpeg: fix playback of AIFF and TTA - vorbis, opus: fix seeking in small files ver 0.21.19 (2020/01/17) diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 0ec77c6f8..2b55316e7 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -781,7 +781,7 @@ static const char *const ffmpeg_mime_types[] = { "audio/x-aac", "audio/x-ac3", "audio/x-adx", - "audio/x-aiff" + "audio/x-aiff", "audio/x-alaw", "audio/x-au", "audio/x-dca", @@ -801,7 +801,7 @@ static const char *const ffmpeg_mime_types[] = { "audio/x-pn-realaudio", "audio/x-pn-multirate-realaudio", "audio/x-speex", - "audio/x-tta" + "audio/x-tta", "audio/x-voc", "audio/x-wav", "audio/x-wma", From 535a099a2744c5b6878a707ed7e3fd76fe48589e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 4 Feb 2020 16:32:13 +0100 Subject: [PATCH 11/12] test/meson.build: drop obsolete gtest warning suppressions --- test/meson.build | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/meson.build b/test/meson.build index 0c7371e89..75914a3ff 100644 --- a/test/meson.build +++ b/test/meson.build @@ -6,10 +6,6 @@ if compiler.get_id() == 'gcc' gtest_compile_args += [ '-Wno-suggest-attribute=format', '-Wno-suggest-attribute=noreturn', - '-Wno-missing-declarations', - - # needed on Jessie for gtest's IsNullLiteralHelper - '-Wno-conversion-null', ] endif From f1ad21d2bf97b6ecb2359afccf389c65c2eb7d13 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 4 Feb 2020 16:35:44 +0100 Subject: [PATCH 12/12] test/meson.build: add -Wno-unused-command-line-argument for clang 9+ --- test/meson.build | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/meson.build b/test/meson.build index 75914a3ff..5818da55d 100644 --- a/test/meson.build +++ b/test/meson.build @@ -9,6 +9,14 @@ if compiler.get_id() == 'gcc' ] endif +if compiler.get_id() == 'clang' and compiler.version().version_compare('>=9') + gtest_compile_args += [ + # work around clang warning caused by GTest's wrong "-lpthread" + # compiler flag + '-Wno-unused-command-line-argument', + ] +endif + gtest_dep = declare_dependency( dependencies: [dependency('gtest', main: true)], compile_args: gtest_compile_args,