diff --git a/NEWS b/NEWS index 43dc6795e..e090e318f 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,12 @@ ver 0.24 (not yet released) * tags - new tag "Mood" +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 - 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/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); 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; 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 1701396df..e2f4711af 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