playlist_list: wait for the input stream to become ready

Without this, seeking may cause MPD to crash.
This commit is contained in:
Max Kellermann 2009-12-27 16:53:47 +01:00
parent bb4cef6a93
commit 58da24b1cb

View File

@ -314,6 +314,16 @@ playlist_list_open_path(struct input_stream *is, const char *path_fs)
return NULL; return 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;
}
}
playlist = playlist_list_open_stream_suffix(is, suffix); playlist = playlist_list_open_stream_suffix(is, suffix);
if (playlist == NULL) if (playlist == NULL)
input_stream_close(is); input_stream_close(is);