diff options
author | Max Kellermann <max@musicpd.org> | 2017-02-19 19:46:18 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-02-19 19:46:18 +0100 |
commit | 7e4627701635afcfd572e0e3cc4d435eb17c3e3e (patch) | |
tree | c78a42a36aac7f75006075ba9054ef386563a115 /src | |
parent | 3b84b998048e59b9d845b0b6f8e31c52a8989d1e (diff) | |
parent | f3b788703e4cc728a415008b0ddd70d1016a09cc (diff) |
Merge branch 'v0.20.x'
Diffstat (limited to 'src')
-rw-r--r-- | src/input/plugins/AlsaInputPlugin.cxx | 1 | ||||
-rw-r--r-- | src/mixer/plugins/AlsaMixerPlugin.cxx | 1 | ||||
-rw-r--r-- | src/output/plugins/httpd/IcyMetaDataServer.cxx | 10 | ||||
-rw-r--r-- | src/tag/Handler.cxx | 2 |
4 files changed, 10 insertions, 4 deletions
diff --git a/src/input/plugins/AlsaInputPlugin.cxx b/src/input/plugins/AlsaInputPlugin.cxx index 2c6b8d09d..9607398e0 100644 --- a/src/input/plugins/AlsaInputPlugin.cxx +++ b/src/input/plugins/AlsaInputPlugin.cxx @@ -101,6 +101,7 @@ public: ~AlsaInputStream() { BlockingCall(MultiSocketMonitor::GetEventLoop(), [this](){ MultiSocketMonitor::Reset(); + DeferredMonitor::Cancel(); }); snd_pcm_close(capture_handle); diff --git a/src/mixer/plugins/AlsaMixerPlugin.cxx b/src/mixer/plugins/AlsaMixerPlugin.cxx index 77bbb8cd9..cf2dc2055 100644 --- a/src/mixer/plugins/AlsaMixerPlugin.cxx +++ b/src/mixer/plugins/AlsaMixerPlugin.cxx @@ -58,6 +58,7 @@ public: ~AlsaMixerMonitor() { BlockingCall(MultiSocketMonitor::GetEventLoop(), [this](){ MultiSocketMonitor::Reset(); + DeferredMonitor::Cancel(); }); } diff --git a/src/output/plugins/httpd/IcyMetaDataServer.cxx b/src/output/plugins/httpd/IcyMetaDataServer.cxx index e2fbddb85..a81d2850a 100644 --- a/src/output/plugins/httpd/IcyMetaDataServer.cxx +++ b/src/output/plugins/httpd/IcyMetaDataServer.cxx @@ -60,7 +60,11 @@ icy_server_metadata_string(const char *stream_title, const char* stream_url) { // The leading n is a placeholder for the length information auto icy_metadata = FormatString("nStreamTitle='%s';" - "StreamUrl='%s';", + "StreamUrl='%s';" + /* pad 15 spaces just in case + the length needs to be + rounded up */ + " ", stream_title, stream_url); @@ -68,7 +72,7 @@ icy_server_metadata_string(const char *stream_title, const char* stream_url) meta_length--; // subtract placeholder - meta_length = ((int)meta_length / 16) + 1; + meta_length = meta_length / 16; icy_metadata[0] = meta_length; @@ -109,5 +113,5 @@ icy_server_metadata_page(const Tag &tag, const TagType *types) if (icy_string.IsNull()) return nullptr; - return Page::Copy(icy_string.c_str(), (icy_string[0] * 16) + 1); + return Page::Copy(icy_string.c_str(), uint8_t(icy_string[0]) * 16 + 1); } diff --git a/src/tag/Handler.cxx b/src/tag/Handler.cxx index c04bddb72..dda760c43 100644 --- a/src/tag/Handler.cxx +++ b/src/tag/Handler.cxx @@ -44,7 +44,7 @@ add_tag_tag(TagType type, const char *value, void *ctx) unsigned n = strtoul(value, &end, 10); if (value != end) { char s[21]; - if (snprintf(s, 21, "%u", n) >= 0) + if (snprintf(s, 21, "%u", n) > 0) tag.AddItem(type, s); } } else |