From 8eae74257d76b6ce8622d2f2aefba895b31db109 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Fri, 9 Aug 2024 16:40:09 +0200 Subject: [PATCH] [mpd] add "httpd" output plugin when enable_http_plugin Return MPD-compatible output of plugin type "httpd" when enable_http_plugin in mpd section of the config is set. Signed-off-by: Fabian Groffen --- src/mpd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/mpd.c b/src/mpd.c index 21868d5d..ec677547 100644 --- a/src/mpd.c +++ b/src/mpd.c @@ -3793,6 +3793,19 @@ mpd_command_outputs(struct evbuffer *evbuf, int argc, char **argv, char **errmsg player_speaker_enumerate(speaker_enum_cb, ¶m); + /* streaming output is not in the speaker list, so add it as pseudo + * element when configured to do so */ + if (mpd_plugin_httpd) + { + evbuffer_add_printf(evbuf, + "outputid: %u\n" + "outputname: MP3 stream\n" + "plugin: httpd\n" + "outputenabled: 1\n", + param.nextid); + param.nextid++; + } + return 0; }