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, ...@@ -183,6 +183,7 @@ CurlInputStream::OnHeaders(unsigned status,
{ {
assert(GetEventLoop().IsInside()); assert(GetEventLoop().IsInside());
assert(!postponed_exception); assert(!postponed_exception);
assert(!icy || !icy->IsDefined());
if (status < 200 || status >= 300) if (status < 200 || status >= 300)
throw FormatRuntimeError("got HTTP status %ld", status); throw FormatRuntimeError("got HTTP status %ld", status);
...@@ -195,9 +196,7 @@ CurlInputStream::OnHeaders(unsigned status, ...@@ -195,9 +196,7 @@ CurlInputStream::OnHeaders(unsigned status,
return; return;
} }
if (!icy->IsDefined() && if (headers.find("accept-ranges") != headers.end())
headers.find("accept-ranges") != headers.end())
/* a stream with icy-metadata is not seekable */
seekable = true; seekable = true;
auto i = headers.find("content-length"); auto i = headers.find("content-length");
...@@ -222,7 +221,7 @@ CurlInputStream::OnHeaders(unsigned status, ...@@ -222,7 +221,7 @@ CurlInputStream::OnHeaders(unsigned status,
SetTag(tag_builder.CommitNew()); SetTag(tag_builder.CommitNew());
} }
if (!icy->IsDefined()) { if (icy) {
i = headers.find("icy-metaint"); i = headers.find("icy-metaint");
if (i != headers.end()) { if (i != headers.end()) {
...@@ -429,6 +428,7 @@ void ...@@ -429,6 +428,7 @@ void
CurlInputStream::DoSeek(offset_type new_offset) CurlInputStream::DoSeek(offset_type new_offset)
{ {
assert(IsReady()); assert(IsReady());
assert(seekable);
const ScopeUnlock unlock(mutex); 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