aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-11-01 13:20:39 +0100
committerMax Kellermann <max@duempel.org>2014-11-01 13:41:18 +0100
commit7d5442e1039869d659533eafcf15d8157bf4c465 (patch)
tree06bebf912f001870020095cb85c81d45ec36df00
parenteab32f2e5d8114d08e392001f0004284267bebd5 (diff)
downloadmpd-7d5442e1039869d659533eafcf15d8157bf4c465.tar.gz
mpd-7d5442e1039869d659533eafcf15d8157bf4c465.tar.xz
mpd-7d5442e1039869d659533eafcf15d8157bf4c465.zip
Decoder, Playlist: ignore URI query string for plugin detection
Use the new uri_get_suffix() overload that removes the query string.
-rw-r--r--NEWS1
-rw-r--r--src/TagStream.cxx3
-rw-r--r--src/decoder/DecoderThread.cxx3
-rw-r--r--src/playlist/PlaylistRegistry.cxx9
4 files changed, 11 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 64490ac36..4982e98ad 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ ver 0.19.2 (not yet released)
- m3u: don't ignore unterminated last line
- m3u: recognize the file suffix ".m3u8"
* decoder
+ - ignore URI query string for plugin detection
- faad: remove workaround for ancient libfaad2 ABI bug
- ffmpeg: recognize MIME type audio/aacp
- mad: fix negative replay gain values
diff --git a/src/TagStream.cxx b/src/TagStream.cxx
index 639763373..6201028f6 100644
--- a/src/TagStream.cxx
+++ b/src/TagStream.cxx
@@ -46,7 +46,8 @@ tag_stream_scan(InputStream &is, const tag_handler &handler, void *ctx)
{
assert(is.IsReady());
- const char *const suffix = uri_get_suffix(is.GetURI());
+ UriSuffixBuffer suffix_buffer;
+ const char *const suffix = uri_get_suffix(is.GetURI(), suffix_buffer);
const char *const mime = is.GetMimeType();
if (suffix == nullptr && mime == nullptr)
diff --git a/src/decoder/DecoderThread.cxx b/src/decoder/DecoderThread.cxx
index a39cfa6e9..dd5518b98 100644
--- a/src/decoder/DecoderThread.cxx
+++ b/src/decoder/DecoderThread.cxx
@@ -237,7 +237,8 @@ static bool
decoder_run_stream_locked(Decoder &decoder, InputStream &is,
const char *uri, bool &tried_r)
{
- const char *const suffix = uri_get_suffix(uri);
+ UriSuffixBuffer suffix_buffer;
+ const char *const suffix = uri_get_suffix(uri, suffix_buffer);
using namespace std::placeholders;
const auto f = std::bind(decoder_run_stream_plugin,
diff --git a/src/playlist/PlaylistRegistry.cxx b/src/playlist/PlaylistRegistry.cxx
index bc5932de3..4e9ef890e 100644
--- a/src/playlist/PlaylistRegistry.cxx
+++ b/src/playlist/PlaylistRegistry.cxx
@@ -139,12 +139,12 @@ static SongEnumerator *
playlist_list_open_uri_suffix(const char *uri, Mutex &mutex, Cond &cond,
const bool *tried)
{
- const char *suffix;
SongEnumerator *playlist = nullptr;
assert(uri != nullptr);
- suffix = uri_get_suffix(uri);
+ UriSuffixBuffer suffix_buffer;
+ const char *const suffix = uri_get_suffix(uri, suffix_buffer);
if (suffix == nullptr)
return nullptr;
@@ -257,7 +257,10 @@ playlist_list_open_stream(InputStream &is, const char *uri)
return playlist;
}
- const char *suffix = uri != nullptr ? uri_get_suffix(uri) : nullptr;
+ UriSuffixBuffer suffix_buffer;
+ const char *suffix = uri != nullptr
+ ? uri_get_suffix(uri, suffix_buffer)
+ : nullptr;
if (suffix != nullptr) {
auto playlist = playlist_list_open_stream_suffix(is, suffix);
if (playlist != nullptr)