From 4a5c7d826183e3b9054511bf361c24b5be3a4e94 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 14 Mar 2022 18:55:49 +0100 Subject: [PATCH 1/4] increment version number to 0.23.7 --- 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 abf3251af..317ea0e46 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +ver 0.23.7 (not yet released) + ver 0.23.6 (2022/03/14) * protocol - support filename "cover.webp" for "albumart" command diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 46533971c..11b375198 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="66" + android:versionName="0.23.7"> diff --git a/doc/conf.py b/doc/conf.py index 971960831..90e51ca9f 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.23.6' +version = '0.23.7' # The full version, including alpha/beta/rc tags. #release = version + '~git' diff --git a/meson.build b/meson.build index e1ab1f997..df5972e75 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'mpd', ['c', 'cpp'], - version: '0.23.6', + version: '0.23.7', meson_version: '>= 0.56.0', default_options: [ 'c_std=c11', From 2be4f8955508fb3f1209d14ec5752eee46ef5dd2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 16 Mar 2022 16:28:00 +0100 Subject: [PATCH 2/4] test/DumpOgg: new debug program --- test/DumpOgg.cxx | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ test/meson.build | 13 +++++++++ 2 files changed, 81 insertions(+) create mode 100644 test/DumpOgg.cxx diff --git a/test/DumpOgg.cxx b/test/DumpOgg.cxx new file mode 100644 index 000000000..e665db921 --- /dev/null +++ b/test/DumpOgg.cxx @@ -0,0 +1,68 @@ +/* + * Copyright 2003-2022 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "lib/xiph/OggSyncState.hxx" +#include "lib/xiph/OggStreamState.hxx" +#include "config/Data.hxx" +#include "input/Init.hxx" +#include "input/InputStream.hxx" +#include "input/Reader.hxx" +#include "event/Thread.hxx" +#include "util/PrintException.hxx" + +#include +#include + +int +main(int argc, char **argv) noexcept +try { + if (argc != 2) { + fprintf(stderr, "Usage: DumpOgg FILE\n"); + return EXIT_FAILURE; + } + + const char *path = argv[1]; + + EventThread io_thread; + io_thread.Start(); + + const ScopeInputPluginsInit input_plugins_init(ConfigData(), + io_thread.GetEventLoop()); + + Mutex mutex; + auto is = InputStream::OpenReady(path, mutex); + + InputStreamReader reader{*is}; + + OggSyncState sync{reader}; + + while (true) { + ogg_page page; + if (!sync.ExpectPage(page)) + break; + + printf("page offset=%" PRIu64 " serial=%d\n", + sync.GetStartOffset(), ogg_page_serialno(&page)); + } + + return EXIT_SUCCESS; +} catch (...) { + PrintException(std::current_exception()); + return EXIT_FAILURE; +} diff --git a/test/meson.build b/test/meson.build index 75c3ff46f..9da7dd691 100644 --- a/test/meson.build +++ b/test/meson.build @@ -490,6 +490,19 @@ if libid3tag_dep.found() ], ) endif + +if ogg_dep.found() + executable( + 'DumpOgg', + 'DumpOgg.cxx', + include_directories: inc, + dependencies: [ + ogg_dep, + input_glue_dep, + archive_glue_dep, + ], + ) +endif # # Filter From a757eebfbbc90f71e70580feb29ed5b95f029f18 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 16 Mar 2022 15:39:01 +0100 Subject: [PATCH 3/4] decoder/OggSyncState: allow skipping up to 64 kB after seek This is more of what we did in commit 70bd35abe2ab because it turns out there are Ogg-Opus files with pages larger than 40 kB. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1487 --- NEWS | 2 ++ src/lib/xiph/OggSyncState.cxx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 317ea0e46..ca04f464d 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.23.7 (not yet released) +* decoder + - opus: fix missing song length on high-latency files ver 0.23.6 (2022/03/14) * protocol diff --git a/src/lib/xiph/OggSyncState.cxx b/src/lib/xiph/OggSyncState.cxx index a36dd6243..3401b68e8 100644 --- a/src/lib/xiph/OggSyncState.cxx +++ b/src/lib/xiph/OggSyncState.cxx @@ -67,7 +67,7 @@ OggSyncState::ExpectPageIn(ogg_stream_state &os) bool OggSyncState::ExpectPageSeek(ogg_page &page) { - size_t remaining_skipped = 32768; + size_t remaining_skipped = 65536; while (true) { int r = ogg_sync_pageseek(&oy, &page); From ac06088948fc1ab415437bcfaf61cdd8245954b0 Mon Sep 17 00:00:00 2001 From: Vitaly Ostrosablin Date: Sat, 19 Mar 2022 13:34:12 +0300 Subject: [PATCH 4/4] Make volume changes to apply to disabled software mixers. Move audio output state check ahead of mixer check and force volume applying even for disabled software mixed outputs. This fixes incorrect software mixer volume that used to occur when volume was changed while output being disabled. This is easily reproduced with following sequence of commands on multi-output software mixed MPD setup. mpc volume 38; mpc disable 3; mpc volume 88; mpc enable 3 On current MPD, following commands would result in output 3 playing at volume 38, while all other enabled outputs would play at volume 88. Moreover, global volume would display average of outputs real volumes. In my case, it's 75. After applying this patch, following commands would produce expected behavior. All outputs play at expected (88) volume. And volume is correctly displayed as 88. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1423 Signed-off-by: Vitaly Ostrosablin tmp6154@yandex.ru Signed-off-by: Vitaly Ostrosablin --- NEWS | 2 ++ src/mixer/MixerAll.cxx | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index ca04f464d..cbea44148 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ ver 0.23.7 (not yet released) * decoder - opus: fix missing song length on high-latency files +* mixer + - software: update volume of disabled outputs ver 0.23.6 (2022/03/14) * protocol diff --git a/src/mixer/MixerAll.cxx b/src/mixer/MixerAll.cxx index f5e066706..da96f93f3 100644 --- a/src/mixer/MixerAll.cxx +++ b/src/mixer/MixerAll.cxx @@ -34,13 +34,15 @@ gcc_pure static int output_mixer_get_volume(const AudioOutputControl &ao) noexcept { - if (!ao.IsEnabled()) - return -1; - auto *mixer = ao.GetMixer(); if (mixer == nullptr) return -1; + /* software mixers are always considered, even if they are + disabled */ + if (!ao.IsEnabled() && !mixer->IsPlugin(software_mixer_plugin)) + return -1; + try { return mixer_get_volume(mixer); } catch (...) { @@ -76,13 +78,15 @@ output_mixer_set_volume(AudioOutputControl &ao, unsigned volume) noexcept { assert(volume <= 100); - if (!ao.IsEnabled()) - return false; - auto *mixer = ao.GetMixer(); if (mixer == nullptr) return false; + /* software mixers are always updated, even if they are + disabled */ + if (!ao.IsEnabled() && !mixer->IsPlugin(software_mixer_plugin)) + return false; + try { mixer_set_volume(mixer, volume); return true;