Merge branch 'v0.23.x'

This commit is contained in:
Max Kellermann 2022-04-26 18:30:34 +02:00
commit ce88dee14d
16 changed files with 187 additions and 89 deletions

6
NEWS
View File

@ -12,10 +12,16 @@ ver 0.24 (not yet released)
- new tag "Mood"
ver 0.23.7 (not yet released)
* database
- upnp: support pupnp 1.14
* decoder
- opus: fix missing song length on high-latency files
* output
- shout: require at least libshout 2.4.0
* mixer
- pipewire: fix volume restore
- software: update volume of disabled outputs
* support libiconv
ver 0.23.6 (2022/03/14)
* protocol

View File

@ -19,6 +19,7 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application android:allowBackup="true"
android:debuggable="true"
android:requestLegacyExternalStorage="true"
android:icon="@drawable/icon"
android:banner="@drawable/icon"

54
android/gdb.sh Executable file
View File

@ -0,0 +1,54 @@
#!/bin/sh
# This script need the following modification in ANDROID_NDK in order to attach
# to the good :main pid
#--- a/prebuilt/linux-x86_64/bin/ndk-gdb.py
#+++ b/prebuilt/linux-x86_64/bin/ndk-gdb.py
#@@ -669,7 +669,7 @@
# log("Sleeping for {} seconds.".format(args.delay))
# time.sleep(args.delay)
#
#- pids = gdbrunner.get_pids(device, pkg_name)
#+ pids = gdbrunner.get_pids(device, pkg_name + ":main")
# if len(pids) == 0:
# error("Failed to find running process '{}'".format(pkg_name))
# if len(pids) > 1:
SCRIPT_PATH=$(dirname $0)
BUILD_PATH="`pwd`"
TMP_PATH="$BUILD_PATH/gdb"
NDK_GDB_ARGS="--force"
ANDROID_NDK=$1
if [ ! -f $ANDROID_NDK/source.properties ];then
echo "usage: $0 ANDROID_NDK"
exit 1
fi
if [ ! -f $BUILD_PATH/libmpd.so ];then
echo "This script need to be executed from the android build directory"
exit 1
fi
rm -rf "$TMP_PATH"
mkdir -p "$TMP_PATH"
ANDROID_MANIFEST="$SCRIPT_PATH/AndroidManifest.xml"
ABI=`ls "$BUILD_PATH/android/apk/apk/lib" --sort=time | head -n 1`
if [ ! -f "$ANDROID_MANIFEST" -o "$ABI" = "" ]; then
echo "Invalid manifest/ABI, did you try building first ?"
exit 1
fi
mkdir -p "$TMP_PATH"/jni
touch "$TMP_PATH"/jni/Android.mk
echo "APP_ABI := $ABI" > "$TMP_PATH"/jni/Application.mk
DEST=obj/local/$ABI
mkdir -p "$TMP_PATH/$DEST"
cp "$BUILD_PATH/libmpd.so" "$TMP_PATH/$DEST"
cp "$ANDROID_MANIFEST" "$TMP_PATH"
(cd "$TMP_PATH" && bash $ANDROID_NDK/ndk-gdb $NDK_GDB_ARGS)

View File

@ -55,8 +55,8 @@ flac = AutotoolsProject(
)
zlib = ZlibProject(
'http://zlib.net/zlib-1.2.11.tar.xz',
'4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066',
'http://zlib.net/zlib-1.2.12.tar.xz',
'7db46b8d7726232a621befaab4a1c870f00a90805511c0e0090441dac57def18',
'lib/libz.a',
)
@ -151,8 +151,8 @@ gme = CmakeProject(
)
ffmpeg = FfmpegProject(
'http://ffmpeg.org/releases/ffmpeg-5.0.tar.xz',
'51e919f7d205062c0fd4fae6243a84850391115104ccf1efc451733bc0ac7298',
'http://ffmpeg.org/releases/ffmpeg-5.0.1.tar.xz',
'ef2efae259ce80a240de48ec85ecb062cecca26e4352ffb3fda562c21a93007b',
'lib/libavcodec.a',
[
'--disable-shared', '--enable-static',
@ -380,8 +380,8 @@ ffmpeg = FfmpegProject(
)
openssl = OpenSSLProject(
'https://www.openssl.org/source/openssl-3.0.1.tar.gz',
'c311ad853353bce796edad01a862c50a8a587f62e7e2100ef465ab53ec9b06d1',
'https://www.openssl.org/source/openssl-3.0.2.tar.gz',
'98e91ccead4d4756ae3c9cde5e09191a8e586d9f4d50838e7ec09d6411dfdb63',
'include/openssl/ossl_typ.h',
)
@ -444,7 +444,7 @@ jack = JackProject(
)
boost = BoostProject(
'https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.bz2',
'8681f175d4bdb26c52222665793eef08490d7758529330f98d3b29dd0735bccc',
'https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2',
'475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39',
'include/boost/version.hpp',
)

View File

@ -12,17 +12,23 @@ if is_windows
icu_sources += 'Win32.cxx'
endif
iconv_dep = []
if icu_dep.found()
icu_sources += [
'Util.cxx',
'Init.cxx',
]
elif not get_option('iconv').disabled()
have_iconv = compiler.has_function('iconv', prefix : '#include <iconv.h>')
conf.set('HAVE_ICONV', have_iconv)
# an installed iconv library will make the builtin iconv() unavailable,
# so search for the library first and pass it as (possible) dependency
iconv_dep = compiler.find_library('libiconv', required: false)
have_iconv = compiler.has_function('iconv',
dependencies: iconv_dep,
prefix : '#include <iconv.h>')
if not have_iconv and get_option('iconv').enabled()
error('iconv() not available')
endif
conf.set('HAVE_ICONV', have_iconv)
endif
icu = static_library(
@ -31,6 +37,7 @@ icu = static_library(
include_directories: inc,
dependencies: [
icu_dep,
iconv_dep,
fmt_dep,
],
)

View File

@ -35,13 +35,7 @@ static unsigned upnp_ref;
static void
DoInit(const char* iface)
{
#ifdef UPNP_ENABLE_IPV6
auto code = UpnpInit2(iface, 0);
#else
auto code = UpnpInit(iface, 0);
#endif
if (code != UPNP_E_SUCCESS)
if (auto code = UpnpInit2(iface, 0); code != UPNP_E_SUCCESS)
throw FormatRuntimeError("UpnpInit() failed: %s",
UpnpGetErrorMessage(code));

View File

@ -84,7 +84,7 @@ output_mixer_set_volume(AudioOutputControl &ao, unsigned volume) noexcept
/* software mixers are always updated, even if they are
disabled */
if (!ao.IsEnabled() && !mixer->IsPlugin(software_mixer_plugin))
if (!ao.IsReallyEnabled() && !mixer->IsPlugin(software_mixer_plugin))
return false;
try {

View File

@ -288,6 +288,13 @@ public:
return !output;
}
/**
* Caller must lock the mutex.
*/
bool IsReallyEnabled() const noexcept {
return really_enabled;
}
/**
* Caller must lock the mutex.
*/

View File

@ -638,8 +638,8 @@ PipeWireOutput::ParamChanged([[maybe_unused]] uint32_t id,
[[maybe_unused]] const struct spa_pod *param) noexcept
{
if (restore_volume) {
SetVolume(volume);
restore_volume = false;
SetVolume(volume);
}
#if defined(ENABLE_DSD) && defined(SPA_AUDIO_DSD_FLAG_NONE)

View File

@ -59,7 +59,7 @@ class ShoutConfig {
public:
ShoutConfig(const ConfigBlock &block, const char *mime_type);
void Setup(shout_t *connection) const;
void Setup(shout_t &connection) const;
};
struct ShoutOutput final : AudioOutput {
@ -229,41 +229,56 @@ ShoutOutput::Create(EventLoop &, const ConfigBlock &block)
return new ShoutOutput(block);
}
inline void
ShoutConfig::Setup(shout_t *connection) const
static void
SetMeta(shout_t &connection, const char *name, const char *value)
{
if (shout_set_host(connection, host) != SHOUTERR_SUCCESS ||
shout_set_port(connection, port) != SHOUTERR_SUCCESS ||
shout_set_password(connection, passwd) != SHOUTERR_SUCCESS ||
shout_set_mount(connection, mount) != SHOUTERR_SUCCESS ||
shout_set_name(connection, name) != SHOUTERR_SUCCESS ||
shout_set_user(connection, user) != SHOUTERR_SUCCESS ||
shout_set_public(connection, is_public) != SHOUTERR_SUCCESS ||
shout_set_format(connection, format) != SHOUTERR_SUCCESS ||
shout_set_protocol(connection, protocol) != SHOUTERR_SUCCESS ||
#ifdef SHOUT_TLS
shout_set_tls(connection, tls) != SHOUTERR_SUCCESS ||
if (shout_set_meta(&connection, name, value) != SHOUTERR_SUCCESS)
throw std::runtime_error(shout_get_error(&connection));
}
static void
SetOptionalMeta(shout_t &connection, const char *name, const char *value)
{
if (value != nullptr)
SetMeta(connection, name, value);
}
inline void
ShoutConfig::Setup(shout_t &connection) const
{
if (shout_set_host(&connection, host) != SHOUTERR_SUCCESS ||
shout_set_port(&connection, port) != SHOUTERR_SUCCESS ||
shout_set_password(&connection, passwd) != SHOUTERR_SUCCESS ||
shout_set_mount(&connection, mount) != SHOUTERR_SUCCESS ||
shout_set_user(&connection, user) != SHOUTERR_SUCCESS ||
shout_set_public(&connection, is_public) != SHOUTERR_SUCCESS ||
#ifdef SHOUT_USAGE_AUDIO
/* since libshout 2.4.3 */
shout_set_content_format(&connection, format, SHOUT_USAGE_AUDIO,
nullptr) != SHOUTERR_SUCCESS ||
#else
shout_set_format(&connection, format) != SHOUTERR_SUCCESS ||
#endif
shout_set_agent(connection, "MPD") != SHOUTERR_SUCCESS)
throw std::runtime_error(shout_get_error(connection));
shout_set_protocol(&connection, protocol) != SHOUTERR_SUCCESS ||
#ifdef SHOUT_TLS
shout_set_tls(&connection, tls) != SHOUTERR_SUCCESS ||
#endif
shout_set_agent(&connection, "MPD") != SHOUTERR_SUCCESS)
throw std::runtime_error(shout_get_error(&connection));
SetMeta(connection, SHOUT_META_NAME, name);
/* optional paramters */
if (genre != nullptr && shout_set_genre(connection, genre))
throw std::runtime_error(shout_get_error(connection));
if (description != nullptr &&
shout_set_description(connection, description))
throw std::runtime_error(shout_get_error(connection));
if (url != nullptr && shout_set_url(connection, url))
throw std::runtime_error(shout_get_error(connection));
SetOptionalMeta(connection, SHOUT_META_GENRE, genre);
SetOptionalMeta(connection, SHOUT_META_DESCRIPTION, description);
SetOptionalMeta(connection, SHOUT_META_URL, url);
if (quality != nullptr)
shout_set_audio_info(connection, SHOUT_AI_QUALITY, quality);
shout_set_audio_info(&connection, SHOUT_AI_QUALITY, quality);
if (bitrate != nullptr)
shout_set_audio_info(connection, SHOUT_AI_BITRATE, bitrate);
shout_set_audio_info(&connection, SHOUT_AI_BITRATE, bitrate);
}
void
@ -274,7 +289,7 @@ ShoutOutput::Enable()
throw std::bad_alloc{};
try {
config.Setup(shout_conn);
config.Setup(*shout_conn);
} catch (...) {
shout_free(shout_conn);
throw;
@ -418,7 +433,7 @@ ShoutOutput::Pause()
}
static void
shout_tag_to_metadata(const Tag &tag, char *dest, size_t size)
shout_tag_to_metadata(const Tag &tag, char *dest, size_t size) noexcept
{
const char *artist = tag.GetValue(TAG_ARTIST);
const char *title = tag.GetValue(TAG_TITLE);
@ -446,9 +461,15 @@ ShoutOutput::SendTag(const Tag &tag)
char song[1024];
shout_tag_to_metadata(tag, song, sizeof(song));
shout_metadata_add(meta, "song", song);
shout_metadata_add(meta, "charset", "UTF-8");
if (SHOUTERR_SUCCESS != shout_set_metadata(shout_conn, meta)) {
if (SHOUTERR_SUCCESS != shout_metadata_add(meta, "song", song) ||
#ifdef SHOUT_FORMAT_TEXT
/* since libshout 2.4.6 */
SHOUTERR_SUCCESS != shout_set_metadata_utf8(shout_conn, meta)
#else
SHOUTERR_SUCCESS != shout_metadata_add(meta, "charset", "UTF-8") ||
SHOUTERR_SUCCESS != shout_set_metadata(shout_conn, meta)
#endif
) {
LogWarning(shout_output_domain,
"error setting shout metadata");
}

View File

@ -99,7 +99,7 @@ if get_option('recorder')
need_encoder = true
endif
libshout_dep = dependency('shout', required: get_option('shout'))
libshout_dep = dependency('shout', version: '>= 2.4.0', required: get_option('shout'))
output_features.set('HAVE_SHOUT', libshout_dep.found())
if libshout_dep.found()
output_plugins_sources += 'ShoutOutputPlugin.cxx'

View File

@ -1,9 +1,12 @@
[wrap-file]
directory = expat-2.2.9
source_url = https://github.com/libexpat/libexpat/releases/download/R_2_2_9/expat-2.2.9.tar.xz
source_filename = expat-2.2.9.tar.bz2
source_hash = 1ea6965b15c2106b6bbe883397271c80dfa0331cdf821b2c319591b55eadc0a4
patch_url = https://wrapdb.mesonbuild.com/v1/projects/expat/2.2.9/3/get_zip
patch_filename = expat-2.2.9-3-wrap.zip
patch_hash = e9aaace62e9a158b5e96f5c38c9f81f369179206acd87697653d777c0d3975d3
[wrap-file]
directory = expat-2.4.8
source_url = https://github.com/libexpat/libexpat/releases/download/R_2_4_8/expat-2.4.8.tar.xz
source_filename = expat-2.4.8.tar.bz2
source_hash = f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df479dcaf25
patch_filename = expat_2.4.8-1_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/expat_2.4.8-1/get_patch
patch_hash = 9aec253a2c6d1c0feb852c5c6920298d14701eeec7acc6832bb402438b52112a
[provide]
expat = expat_dep

View File

@ -1,11 +1,11 @@
[wrap-file]
directory = fmt-7.1.3
source_url = https://github.com/fmtlib/fmt/archive/7.1.3.tar.gz
source_filename = fmt-7.1.3.tar.gz
source_hash = 5cae7072042b3043e12d53d50ef404bbb76949dad1de368d7f993a15c8c05ecc
patch_url = https://wrapdb.mesonbuild.com/v1/projects/fmt/7.1.3/1/get_zip
patch_filename = fmt-7.1.3-1-wrap.zip
patch_hash = 6eb951a51806fd6ffd596064825c39b844c1fe1799840ef507b61a53dba08213
directory = fmt-8.1.1
source_url = https://github.com/fmtlib/fmt/archive/8.1.1.tar.gz
source_filename = fmt-8.1.1.tar.gz
source_hash = 3d794d3cf67633b34b2771eb9f073bde87e846e0d395d254df7b211ef1ec7346
patch_filename = fmt_8.1.1-1_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/fmt_8.1.1-1/get_patch
patch_hash = 6035a67c7a8c90bed74c293c7265c769f47a69816125f7566bccb8e2543cee5e
[provide]
fmt = fmt_dep

View File

@ -1,10 +1,15 @@
[wrap-file]
directory = googletest-release-1.10.0
directory = googletest-release-1.11.0
source_url = https://github.com/google/googletest/archive/release-1.11.0.tar.gz
source_filename = gtest-1.11.0.tar.gz
source_hash = b4870bf121ff7795ba20d20bcdd8627b8e088f2d1dab299a031c1034eddc93d5
patch_filename = gtest_1.11.0-2_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/gtest_1.11.0-2/get_patch
patch_hash = 764530d812ac161c9eab02a8cfaec67c871fcfc5548e29fd3d488070913d4e94
source_url = https://github.com/google/googletest/archive/release-1.10.0.zip
source_filename = gtest-1.10.0.zip
source_hash = 94c634d499558a76fa649edb13721dce6e98fb1e7018dfaeba3cd7a083945e91
[provide]
gtest = gtest_dep
gtest_main = gtest_main_dep
gmock = gmock_dep
gmock_main = gmock_main_dep
patch_url = https://wrapdb.mesonbuild.com/v1/projects/gtest/1.10.0/1/get_zip
patch_filename = gtest-1.10.0-1-wrap.zip
patch_hash = 04ff14e8880e4e465f6260221e9dfd56fea6bc7cce4c4aff0dc528e4a2c8f514

View File

@ -1,11 +1,11 @@
[wrap-file]
directory = sqlite-amalgamation-3340100
source_url = https://www.sqlite.org/2021/sqlite-amalgamation-3340100.zip
source_filename = sqlite-amalgamation-3340100.zip
source_hash = e0b1c0345fe4338b936e17da8e1bd88366cd210e576834546977f040c12a8f68
patch_url = https://wrapdb.mesonbuild.com/v1/projects/sqlite3/3.34.1/1/get_zip
patch_filename = sqlite3-3.34.1-1-wrap.zip
patch_hash = cba9e47bdb4c02f88fadaae8deab357218d32562c6b86ce7ba0c72f107044360
directory = sqlite-amalgamation-3380000
source_url = https://sqlite.org/2022/sqlite-amalgamation-3380000.zip
source_filename = sqlite-amalgamation-3380000.zip
source_hash = e055f6054e97747a135c89e36520c0a423249e8a91c5fc445163f4a6adb20df6
patch_filename = sqlite3_3.38.0-1_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/sqlite3_3.38.0-1/get_patch
patch_hash = 49e30bf010ff63ab772d5417885e6905379025ceac80382e292c6dbd3a9da744
[provide]
sqlite3 = sqlite3_dep

View File

@ -1,11 +1,11 @@
[wrap-file]
directory = libvorbis-1.3.5
source_url = http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.xz
source_filename = libvorbis-1.3.5.tar.xz
source_hash = 54f94a9527ff0a88477be0a71c0bab09a4c3febe0ed878b24824906cd4b0e1d1
patch_url = https://wrapdb.mesonbuild.com/v1/projects/vorbis/1.3.5/7/get_zip
patch_filename = vorbis-1.3.5-7-wrap.zip
patch_hash = 7f4d3f9253925196461d52fd4553aad4468fd845560d1ff6c2eb6a012cf64fb0
directory = libvorbis-1.3.7
source_url = https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.xz
source_filename = libvorbis-1.3.7.tar.xz
source_hash = b33cc4934322bcbf6efcbacf49e3ca01aadbea4114ec9589d1b1e9d20f72954b
patch_filename = vorbis_1.3.7-2_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/vorbis_1.3.7-2/get_patch
patch_hash = fe302576cbf8408754b332b539ea1b83f0f96fa9aae50a5d1fea911713d5f21c
[provide]
vorbis = vorbis_dep