Compare commits

...

18 Commits

Author SHA1 Message Date
Max Kellermann
b8bfc98618 release v0.23.15 2023-12-20 16:21:57 +01:00
Max Kellermann
6e6f72a521 win32/HResult: convert assert() to runtime check to work around -Walloc-size-larger-than 2023-12-20 16:15:58 +01:00
Max Kellermann
a654c5d643 Revert "android: Fix MPD shutdown from settings UI"
This reverts commit 94b5b9f370.  It was
not necessary for branch v0.23.x because there, Break() is
thread-safe; this was only changed later by commit
a3b32819b1
2023-12-20 16:15:58 +01:00
Max Kellermann
c5d6aa169f lib/curl/patches: refresh no_CMAKE_C_IMPLICIT_LINK_LIBRARIES.patch for 7.85.0 2023-12-20 13:43:20 +01:00
Max Kellermann
c1c67286d3 python/build/libs.py: update CURL to 8.5.0 2023-12-20 13:28:54 +01:00
borine
2fb34697c7 input/plugins/Alsa: catch all exceptions
snd_pcm_poll_descriptors_revents() may return any error code; the
ALSA docs do not constrain the permitted values. A 'hw' device
will only ever return an error if the pfd array passed in is
invalid (-EINVAL), but other I/O plugins may return arbitary
errors. For example a network-based device may return -EPIPE etc.
The resulting exception thrown by
AlsaNonBlockPcm::DispatchSockets() must be caught to prevent the
mpd process from being aborted.
2023-12-20 13:27:25 +01:00
Colin Edwards
94b5b9f370 android: Fix MPD shutdown from settings UI 2023-12-20 13:27:16 +01:00
Max Kellermann
a9467513e1 doc/developer.rst: add missing return type to code style sample 2023-12-20 13:26:48 +01:00
borine
17d944f6ce input/plugins/Alsa: limit ALSA buffer time to 2 seconds maximum
Some ALSA capture devices can have very large buffers, holding 10
seconds or more audio. Using the maximum buffer size with such
devices leads to unacceptably large, and unnecessary, latency.
Also, some ALSA drivers (e.g. HDA Intel PCH) report an invalid
maximum period size, and the period size that mpd calculates from
the maximum buffer size results in "Invalid argument" error when
applying the hw_params. Note that the "default" capture device on
many cards includes the "dsnoop" plugin which imposes a buffer
size of 16384 frames, so that "alsa://" works OK but
"alsa://plughw" or "alsa://hw" both fail.

Limit the maximum buffer time for ALSA input devices to a more useable
2 seconds, thereby avoiding both the above problems.
2023-12-20 13:26:24 +01:00
Max Kellermann
0f82f18652 python/build/libs.py: update CURL to 8.4.0 2023-12-20 13:25:08 +01:00
Max Kellermann
3db3e577f1 python/build/libs.py: update OpenSSL to 3.1.4 2023-12-20 13:25:04 +01:00
Max Kellermann
37ee821947 python/build/libs.py: update FFmpeg to 6.1 2023-12-20 13:25:00 +01:00
Max Kellermann
916ab9a7e6 python/build/libs.py: update openmpt to 0.7.3 2023-12-20 13:24:57 +01:00
Max Kellermann
1802cf9fd1 python/build/cmake.py: add CMAKE_FIND_ROOT_PATH on Windows
Works around CURL build failure because cmake insists on using
/usr/include/zlib.h.
2023-12-20 13:24:53 +01:00
Max Kellermann
1bf7d30623 subprojects: update fmt to 10.1.1-1 2023-12-20 13:24:14 +01:00
naglis
b2d89253a6 doc/protocol.rst: mention song id lifetime 2023-12-20 13:23:03 +01:00
skidoo23
50c1e3738a decoder/ffmpeg: Fix build error with ffmpeg 6.1
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1898
2023-11-21 20:36:37 +01:00
Max Kellermann
7a939746ae increment version number to 0.23.15 2023-11-21 20:32:45 +01:00
12 changed files with 76 additions and 46 deletions

6
NEWS

@@ -1,3 +1,9 @@
ver 0.23.15 (2023/12/20)
* decoder
- ffmpeg: fix build failure with FFmpeg 6.1
* output
- alsa: limit buffer time to 2 seconds
ver 0.23.14 (2023/10/08)
* decoder
- flac: fix scanning files with non-ASCII names on Windows

@@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.musicpd"
android:installLocation="auto"
android:versionCode="72"
android:versionName="0.23.14">
android:versionCode="73"
android:versionName="0.23.15">
<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="30"/>

@@ -20,6 +20,7 @@ Some example code:
.. code-block:: c
int
Foo(const char *abc, int xyz)
{
if (abc == nullptr) {

@@ -691,7 +691,8 @@ Song ids on the other hand are stable: an id is assigned to a song
when it is added, and will stay the same, no matter how much it is
moved around. Adding the same song twice will assign different ids to
them, and a deleted-and-readded song will have a new id. This way, a
client can always be sure the correct song is being used.
client can always be sure the correct song is being used. Song ids are not
preserved across :program:`MPD` restarts.
Many commands come in two flavors, one for each address type.
Whenever possible, ids should be used.

@@ -1,7 +1,7 @@
project(
'mpd',
['c', 'cpp'],
version: '0.23.14',
version: '0.23.15',
meson_version: '>= 0.56.0',
default_options: [
'c_std=c11',

@@ -53,6 +53,14 @@ set(CMAKE_CXX_FLAGS_INIT "{toolchain.cxxflags} {toolchain.cppflags}")
set(CMAKE_FIND_ROOT_PATH "{toolchain.install_prefix};{sysroot}")
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
""")
elif cmake_system_name == 'Windows':
# search libraries and headers only in the sysroot, not on
# the build host
f.write(f"""
set(CMAKE_FIND_ROOT_PATH "{toolchain.install_prefix}")
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
""")
def configure(toolchain: AnyToolchain, src: str, build: str, args: list[str]=[], env: Optional[Mapping[str, str]]=None) -> None:

@@ -116,8 +116,8 @@ libmodplug = AutotoolsProject(
)
libopenmpt = AutotoolsProject(
'https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-0.6.6+release.autotools.tar.gz',
'6ddb9e26a430620944891796fefb1bbb38bd9148f6cfc558810c0d3f269876c7',
'https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-0.7.3+release.autotools.tar.gz',
'2cf8369b7916b09264f3f14b9fb6cef35a6e9bee0328dec4f49d98211ccfd722',
'lib/libopenmpt.a',
[
'--disable-shared', '--enable-static',
@@ -156,8 +156,8 @@ gme = CmakeProject(
)
ffmpeg = FfmpegProject(
'http://ffmpeg.org/releases/ffmpeg-6.0.tar.xz',
'57be87c22d9b49c112b6d24bc67d42508660e6b718b3db89c44e47e289137082',
'http://ffmpeg.org/releases/ffmpeg-6.1.tar.xz',
'488c76e57dd9b3bee901f71d5c95eaf1db4a5a31fe46a28654e837144207c270',
'lib/libavcodec.a',
[
'--disable-shared', '--enable-static',
@@ -464,6 +464,8 @@ ffmpeg = FfmpegProject(
'--disable-decoder=pam',
'--disable-decoder=pbm',
'--disable-decoder=pcx',
'--disable-decoder=pdv',
'--disable-decoder=pfm',
'--disable-decoder=pgm',
'--disable-decoder=pgmyuv',
'--disable-decoder=pgssub',
@@ -600,16 +602,16 @@ ffmpeg = FfmpegProject(
)
openssl = OpenSSLProject(
('https://www.openssl.org/source/openssl-3.1.3.tar.gz',
'https://artfiles.org/openssl.org/source/openssl-3.1.3.tar.gz'),
'f0316a2ebd89e7f2352976445458689f80302093788c466692fb2a188b2eacf6',
('https://www.openssl.org/source/openssl-3.1.4.tar.gz',
'https://artfiles.org/openssl.org/source/openssl-3.1.4.tar.gz'),
'840af5366ab9b522bde525826be3ef0fb0af81c6a9ebd84caa600fea1731eee3',
'include/openssl/ossl_typ.h',
)
curl = CmakeProject(
('https://curl.se/download/curl-8.2.1.tar.xz',
'https://github.com/curl/curl/releases/download/curl-8_2_1/curl-8.2.1.tar.xz'),
'dd322f6bd0a20e6cebdfd388f69e98c3d183bed792cf4713c8a7ef498cba4894',
('https://curl.se/download/curl-8.5.0.tar.xz',
'https://github.com/curl/curl/releases/download/curl-8_5_0/curl-8.5.0.tar.xz'),
'42ab8db9e20d8290a3b633e7fbb3cec15db34df65fd1015ef8ac1e4723750eeb',
'lib/libcurl.a',
[
'-DBUILD_CURL_EXE=OFF',

@@ -26,6 +26,9 @@
extern "C" {
#include <libavutil/mem.h>
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(58, 29, 100)
#include <libavutil/error.h>
#endif
}
AvioStream::~AvioStream()

@@ -234,7 +234,7 @@ AlsaInputStream::PrepareSockets() noexcept
void
AlsaInputStream::DispatchSockets() noexcept
{
try {
non_block.DispatchSockets(*this, capture_handle);
const std::scoped_lock<Mutex> protect(mutex);
@@ -253,16 +253,17 @@ AlsaInputStream::DispatchSockets() noexcept
if (n_frames == -EAGAIN)
return;
if (Recover(n_frames) < 0) {
postponed_exception = std::make_exception_ptr(std::runtime_error("PCM error - stream aborted"));
InvokeOnAvailable();
return;
}
if (Recover(n_frames) < 0)
throw std::runtime_error("PCM error - stream aborted");
}
size_t nbytes = n_frames * frame_size;
CommitWriteBuffer(nbytes);
}
catch (...) {
postponed_exception = std::current_exception();
InvokeOnAvailable();
}
inline int
AlsaInputStream::Recover(int err)
@@ -369,9 +370,14 @@ AlsaInputStream::ConfigureCapture(AudioFormat audio_format)
period_size_min, period_size_max,
period_time_min, period_time_max);
/* choose the maximum possible buffer_size ... */
snd_pcm_hw_params_set_buffer_size(capture_handle, hw_params,
buffer_size_max);
/* choose the maximum buffer_time up to limit of 2 seconds ... */
unsigned buffer_time = buffer_time_max;
if (buffer_time > 2000000U)
buffer_time = 2000000U;
int direction = -1;
if ((err = snd_pcm_hw_params_set_buffer_time_near(capture_handle,
hw_params, &buffer_time, &direction)) < 0)
throw Alsa::MakeError(err, "Cannot set buffer time");
/* ... and calculate the period_size to have four periods in
one buffer; this way, we get woken up often enough to avoid
@@ -379,7 +385,7 @@ AlsaInputStream::ConfigureCapture(AudioFormat audio_format)
snd_pcm_uframes_t buffer_size;
if (snd_pcm_hw_params_get_buffer_size(hw_params, &buffer_size) == 0) {
snd_pcm_uframes_t period_size = buffer_size / 4;
int direction = -1;
direction = -1;
if ((err = snd_pcm_hw_params_set_period_size_near(capture_handle,
hw_params, &period_size, &direction)) < 0)
throw Alsa::MakeError(err, "Cannot set period size");

@@ -1,13 +1,13 @@
Index: curl-7.84.0/CMakeLists.txt
Index: curl-7.85.0/CMakeLists.txt
===================================================================
--- curl-7.84.0.orig/CMakeLists.txt
+++ curl-7.84.0/CMakeLists.txt
@@ -1536,7 +1536,7 @@ set(includedir "\${prefix}/
set(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
set(LIBCURL_LIBS "")
set(libdir "${CMAKE_INSTALL_PREFIX}/lib")
-foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS})
+foreach(_lib ${CURL_LIBS})
if(TARGET "${_lib}")
set(_libname "${_lib}")
get_target_property(_imported "${_libname}" IMPORTED)
--- curl-7.85.0.orig/CMakeLists.txt
+++ curl-7.85.0/CMakeLists.txt
@@ -1655,7 +1655,7 @@
set(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
set(LIBCURL_LIBS "")
set(libdir "${CMAKE_INSTALL_PREFIX}/lib")
- foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS})
+ foreach(_lib ${CURL_LIBS})
if(TARGET "${_lib}")
set(_libname "${_lib}")
get_target_property(_imported "${_libname}" IMPORTED)

@@ -100,9 +100,11 @@ FormatHResultError(HRESULT result, const char *fmt, ...) noexcept
va_start(args1, fmt);
va_copy(args2, args1);
const int size = vsnprintf(nullptr, 0, fmt, args1);
int size = vsnprintf(nullptr, 0, fmt, args1);
va_end(args1);
assert(size >= 0);
if (size < 0)
size = 0;
auto buffer = std::make_unique<char[]>(size + 1);
vsprintf(buffer.get(), fmt, args2);

@@ -1,12 +1,13 @@
[wrap-file]
directory = fmt-9.1.0
source_url = https://github.com/fmtlib/fmt/archive/9.1.0.tar.gz
source_filename = fmt-9.1.0.tar.gz
source_hash = 5dea48d1fcddc3ec571ce2058e13910a0d4a6bab4cc09a809d8b1dd1c88ae6f2
patch_filename = fmt_9.1.0-1_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/fmt_9.1.0-1/get_patch
patch_hash = 4557b9ba87b3eb63694ed9b21d1a2117d4a97ca56b91085b10288e9a5294adf8
wrapdb_version = 9.1.0-1
directory = fmt-10.1.1
source_url = https://github.com/fmtlib/fmt/archive/10.1.1.tar.gz
source_filename = fmt-10.1.1.tar.gz
source_hash = 78b8c0a72b1c35e4443a7e308df52498252d1cefc2b08c9a97bc9ee6cfe61f8b
patch_filename = fmt_10.1.1-1_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/fmt_10.1.1-1/get_patch
patch_hash = adec33acaf87c0859c52b242a44bc71c3427751da3f1adaed511f4186794a42f
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/fmt_10.1.1-1/fmt-10.1.1.tar.gz
wrapdb_version = 10.1.1-1
[provide]
fmt = fmt_dep