Merge branch 'v0.23.x'

This commit is contained in:
Max Kellermann 2022-03-26 06:49:51 +01:00
commit a360475c7b
6 changed files with 100 additions and 9 deletions

6
NEWS
View File

@ -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

View File

@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.musicpd"
android:installLocation="auto"
android:versionCode="65"
android:versionName="0.23.5">
android:versionCode="66"
android:versionName="0.23.7">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>

View File

@ -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);

View File

@ -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;

68
test/DumpOgg.cxx Normal file
View File

@ -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 <inttypes.h>
#include <stdio.h>
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;
}

View File

@ -491,6 +491,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
#