Decoder, Playlist: ignore URI query string for plugin detection

Use the new uri_get_suffix() overload that removes the query string.
This commit is contained in:
Max Kellermann 2014-11-01 13:20:39 +01:00
parent 674091424e
commit 32b5654a6e
3 changed files with 9 additions and 6 deletions

1
NEWS
View File

@ -3,6 +3,7 @@ ver 0.18.17 (not yet released)
- don't allow empty playlist name - don't allow empty playlist name
- m3u: recognize the file suffix ".m3u8" - m3u: recognize the file suffix ".m3u8"
* decoder * decoder
- ignore URI query string for plugin detection
- faad: remove workaround for ancient libfaad2 ABI bug - faad: remove workaround for ancient libfaad2 ABI bug
- ffmpeg: recognize MIME type audio/aacp - ffmpeg: recognize MIME type audio/aacp

View File

@ -212,7 +212,8 @@ static bool
decoder_run_stream_locked(Decoder &decoder, InputStream &is, decoder_run_stream_locked(Decoder &decoder, InputStream &is,
const char *uri, bool &tried_r) 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; using namespace std::placeholders;
const auto f = std::bind(decoder_run_stream_plugin, const auto f = std::bind(decoder_run_stream_plugin,

View File

@ -164,12 +164,12 @@ static SongEnumerator *
playlist_list_open_uri_suffix(const char *uri, Mutex &mutex, Cond &cond, playlist_list_open_uri_suffix(const char *uri, Mutex &mutex, Cond &cond,
const bool *tried) const bool *tried)
{ {
const char *suffix;
SongEnumerator *playlist = nullptr; SongEnumerator *playlist = nullptr;
assert(uri != 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) if (suffix == nullptr)
return nullptr; return nullptr;
@ -273,8 +273,6 @@ playlist_list_open_stream_suffix(InputStream &is, const char *suffix)
SongEnumerator * SongEnumerator *
playlist_list_open_stream(InputStream &is, const char *uri) playlist_list_open_stream(InputStream &is, const char *uri)
{ {
const char *suffix;
is.LockWaitReady(); is.LockWaitReady();
const char *const mime = is.GetMimeType(); const char *const mime = is.GetMimeType();
@ -284,7 +282,10 @@ playlist_list_open_stream(InputStream &is, const char *uri)
return playlist; return playlist;
} }
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) { if (suffix != nullptr) {
auto playlist = playlist_list_open_stream_suffix(is, suffix); auto playlist = playlist_list_open_stream_suffix(is, suffix);
if (playlist != nullptr) if (playlist != nullptr)