Commit 898d885a authored by Max Kellermann's avatar Max Kellermann

test/dump_playlist: try playlist_list_open_uri() first

parent a61d0c95
......@@ -43,6 +43,7 @@ int main(int argc, char **argv)
{
const char *uri;
struct input_stream is;
bool stream_open = false;
bool success;
GError *error = NULL;
struct playlist_provider *playlist;
......@@ -74,6 +75,10 @@ int main(int argc, char **argv)
input_stream_global_init();
playlist_list_global_init();
/* open the playlist */
playlist = playlist_list_open_uri(uri);
if (playlist == NULL) {
/* open the stream and wait until it becomes ready */
success = input_stream_open(&is, uri);
......@@ -93,6 +98,8 @@ int main(int argc, char **argv)
g_usleep(10000);
}
stream_open = true;
/* open the playlist */
playlist = playlist_list_open_stream(&is, uri);
......@@ -101,6 +108,7 @@ int main(int argc, char **argv)
g_printerr("Failed to open playlist\n");
return 2;
}
}
/* dump the playlist */
......@@ -115,6 +123,7 @@ int main(int argc, char **argv)
/* deinitialize everything */
playlist_plugin_close(playlist);
if (stream_open)
input_stream_close(&is);
playlist_list_global_finish();
input_stream_global_finish();
......
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