InputStream: add static method OpenReady()

Merge some duplicate code.
This commit is contained in:
Max Kellermann
2013-12-29 18:08:49 +01:00
parent ea9aff1d3f
commit aeb2baa495
11 changed files with 47 additions and 62 deletions

View File

@@ -254,8 +254,8 @@ soundcloud_parse_json(const char *url, yajl_handle hand,
Mutex &mutex, Cond &cond)
{
Error error;
InputStream *input_stream = InputStream::Open(url, mutex, cond,
error);
InputStream *input_stream = InputStream::OpenReady(url, mutex, cond,
error);
if (input_stream == nullptr) {
if (error.IsDefined())
LogError(error);
@@ -263,7 +263,6 @@ soundcloud_parse_json(const char *url, yajl_handle hand,
}
mutex.lock();
input_stream->WaitReady();
yajl_status stat;
int done = 0;