Merge tag 'v0.22.9'

release v0.22.9
This commit is contained in:
Max Kellermann
2021-06-23 21:02:06 +02:00
12 changed files with 48 additions and 19 deletions

View File

@@ -489,6 +489,15 @@ MainConfigured(const struct options &options, const ConfigData &raw_config)
LogError(std::current_exception(),
"Zeroconf initialization failed");
}
AtScopeExit(&zeroconf, &instance) {
if (zeroconf) {
auto &event_loop = instance.io_thread.GetEventLoop();
BlockingCall(event_loop, [&](){
zeroconf.reset();
});
}
};
#endif
#ifdef ENABLE_DATABASE
@@ -550,16 +559,6 @@ MainConfigured(const struct options &options, const ConfigData &raw_config)
instance.state_file->Write();
instance.BeginShutdownUpdate();
#ifdef HAVE_ZEROCONF
if (zeroconf) {
auto &event_loop = instance.io_thread.GetEventLoop();
BlockingCall(event_loop, [&](){
zeroconf.reset();
});
}
#endif
instance.BeginShutdownPartitions();
}

View File

@@ -25,6 +25,7 @@
#include "client/Client.hxx"
#include "protocol/Ack.hxx"
#include "fs/AllocatedPath.hxx"
#include "input/InputStream.hxx"
#include "util/Compiler.h"
#include "util/UriExtract.hxx"
#include "LocateUri.hxx"
@@ -32,8 +33,13 @@
static void
TagScanStream(const char *uri, TagHandler &handler)
{
if (!tag_stream_scan(uri, handler))
Mutex mutex;
auto is = InputStream::OpenReady(uri, mutex);
if (!tag_stream_scan(*is, handler))
throw ProtocolError(ACK_ERROR_NO_EXIST, "Failed to load file");
ScanGenericTags(*is, handler);
}
static void

View File

@@ -430,6 +430,7 @@ SendGroup(mpd_connection *connection, TagType group)
return mpd_search_add_group_tag(connection, tag);
#else
(void)connection;
(void)group;
throw std::runtime_error("Grouping requires libmpdclient 2.12");
#endif

View File

@@ -470,6 +470,7 @@ IsSeekable(const AVFormatContext &format_context) noexcept
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 6, 100)
return (format_context.ctx_flags & AVFMTCTX_UNSEEKABLE) != 0;
#else
(void)format_context;
return false;
#endif
}
@@ -658,6 +659,8 @@ ffmpeg_scan_stream(InputStream &is, TagHandler &handler)
return FfmpegScanStream(*f, handler);
}
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 9, 100)
static void
ffmpeg_uri_decode(DecoderClient &client, const char *uri)
{
@@ -689,6 +692,8 @@ ffmpeg_protocols() noexcept
return protocols;
}
#endif
/**
* A list of extensions found for the formats supported by ffmpeg.
* This list is current as of 02-23-09; To find out if there are more
@@ -812,6 +817,8 @@ static const char *const ffmpeg_mime_types[] = {
constexpr DecoderPlugin ffmpeg_decoder_plugin =
DecoderPlugin("ffmpeg", ffmpeg_decode, ffmpeg_scan_stream)
.WithInit(ffmpeg_init, ffmpeg_finish)
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 9, 100)
.WithProtocols(ffmpeg_protocols, ffmpeg_uri_decode)
#endif
.WithSuffixes(ffmpeg_suffixes)
.WithMimeTypes(ffmpeg_mime_types);

View File

@@ -32,6 +32,7 @@ LastInputStream::~LastInputStream() noexcept = default;
void
LastInputStream::Close() noexcept
{
uri.clear();
is.reset();
close_timer.Cancel();
}

View File

@@ -64,8 +64,7 @@ public:
return is.get();
}
is.reset();
close_timer.Cancel();
Close();
is = open(new_uri, mutex);
uri = std::forward<U>(new_uri);