playlist_list: wait for input stream to become ready
Fixes an assertion failure in the input_stream_seek() call.
This commit is contained in:
parent
a219d488d0
commit
ca6110d92f
@ -192,11 +192,22 @@ playlist_list_open_uri(const char *uri)
|
||||
static struct playlist_provider *
|
||||
playlist_list_open_stream_mime(struct input_stream *is)
|
||||
{
|
||||
GError* error = NULL;
|
||||
struct playlist_provider *playlist;
|
||||
|
||||
assert(is != NULL);
|
||||
assert(is->mime != NULL);
|
||||
|
||||
while (!is->ready) {
|
||||
int ret = input_stream_buffer(is, &error);
|
||||
if (ret < 0) {
|
||||
input_stream_close(is);
|
||||
g_warning("%s", error->message);
|
||||
g_error_free(error);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned i = 0; playlist_plugins[i] != NULL; ++i) {
|
||||
const struct playlist_plugin *plugin = playlist_plugins[i];
|
||||
|
||||
@ -220,11 +231,22 @@ playlist_list_open_stream_mime(struct input_stream *is)
|
||||
static struct playlist_provider *
|
||||
playlist_list_open_stream_suffix(struct input_stream *is, const char *suffix)
|
||||
{
|
||||
GError* error = NULL;
|
||||
struct playlist_provider *playlist;
|
||||
|
||||
assert(is != NULL);
|
||||
assert(suffix != NULL);
|
||||
|
||||
while (!is->ready) {
|
||||
int ret = input_stream_buffer(is, &error);
|
||||
if (ret < 0) {
|
||||
input_stream_close(is);
|
||||
g_warning("%s", error->message);
|
||||
g_error_free(error);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned i = 0; playlist_plugins[i] != NULL; ++i) {
|
||||
const struct playlist_plugin *plugin = playlist_plugins[i];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user