diff options
author | Max Kellermann <max@musicpd.org> | 2018-01-11 14:55:29 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-01-11 14:55:29 +0100 |
commit | 70c4b621cf20bb5b90b3fb6aa54d5adf20d34faf (patch) | |
tree | 42c31cd1965d6026f92303cbb7450742278bd5c7 /src | |
parent | a8df5e109b1adb2b12b239f4794a3e7c79a51c19 (diff) |
input/curl: remove impossible "icy" checks
The IcyMetaDataParser cannot be initialized already in OnHeaders(),
because it will be initialized late in that method; and there will not
be another OnHeaders() call, because streams with Icy metadata are not
seekable, thus there will not be another HTTP request.
Diffstat (limited to 'src')
-rw-r--r-- | src/input/plugins/CurlInputPlugin.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx index b53faed07..63c6e7eb1 100644 --- a/src/input/plugins/CurlInputPlugin.cxx +++ b/src/input/plugins/CurlInputPlugin.cxx @@ -183,6 +183,7 @@ CurlInputStream::OnHeaders(unsigned status, { assert(GetEventLoop().IsInside()); assert(!postponed_exception); + assert(!icy || !icy->IsDefined()); if (status < 200 || status >= 300) throw FormatRuntimeError("got HTTP status %ld", status); @@ -195,9 +196,7 @@ CurlInputStream::OnHeaders(unsigned status, return; } - if (!icy->IsDefined() && - headers.find("accept-ranges") != headers.end()) - /* a stream with icy-metadata is not seekable */ + if (headers.find("accept-ranges") != headers.end()) seekable = true; auto i = headers.find("content-length"); @@ -222,7 +221,7 @@ CurlInputStream::OnHeaders(unsigned status, SetTag(tag_builder.CommitNew()); } - if (!icy->IsDefined()) { + if (icy) { i = headers.find("icy-metaint"); if (i != headers.end()) { @@ -429,6 +428,7 @@ void CurlInputStream::DoSeek(offset_type new_offset) { assert(IsReady()); + assert(seekable); const ScopeUnlock unlock(mutex); |