aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-12-27 16:53:47 +0100
committerMax Kellermann <max@duempel.org>2009-12-27 16:53:47 +0100
commit58da24b1cb685b5235dc5a528651b96a35b5b5bf (patch)
tree918ea54a203015f878449d9dae7dc38184b050c3
parentbb4cef6a937a833c54f251f3e7a7f378e285b9b5 (diff)
downloadmpd-58da24b1cb685b5235dc5a528651b96a35b5b5bf.tar.gz
mpd-58da24b1cb685b5235dc5a528651b96a35b5b5bf.tar.xz
mpd-58da24b1cb685b5235dc5a528651b96a35b5b5bf.zip
playlist_list: wait for the input stream to become ready
Without this, seeking may cause MPD to crash.
Diffstat (limited to '')
-rw-r--r--src/playlist_list.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/playlist_list.c b/src/playlist_list.c
index 540810654..e0013b619 100644
--- a/src/playlist_list.c
+++ b/src/playlist_list.c
@@ -314,6 +314,16 @@ playlist_list_open_path(struct input_stream *is, const char *path_fs)
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);
if (playlist == NULL)
input_stream_close(is);