Commit 70c4b621 authored by Max Kellermann's avatar Max Kellermann

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.
parent a8df5e10
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment