aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist_print.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/playlist_print.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/playlist_print.c b/src/playlist_print.c
index 89ab2e5ab..a6bf84ccd 100644
--- a/src/playlist_print.c
+++ b/src/playlist_print.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2010 The Music Player Daemon Project
+ * Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -23,6 +23,7 @@
#include "playlist_plugin.h"
#include "playlist_any.h"
#include "playlist_song.h"
+#include "playlist.h"
#include "queue_print.h"
#include "stored_playlist.h"
#include "song_print.h"
@@ -116,11 +117,12 @@ playlist_print_changes_position(struct client *client,
}
bool
-spl_print(struct client *client, const char *name_utf8, bool detail)
+spl_print(struct client *client, const char *name_utf8, bool detail,
+ GError **error_r)
{
GPtrArray *list;
- list = spl_load(name_utf8);
+ list = spl_load(name_utf8, error_r);
if (list == NULL)
return false;
@@ -153,7 +155,7 @@ playlist_provider_print(struct client *client, const char *uri,
char *base_uri = uri != NULL ? g_path_get_dirname(uri) : NULL;
while ((song = playlist_plugin_read(playlist)) != NULL) {
- song = playlist_check_translate_song(song, base_uri);
+ song = playlist_check_translate_song(song, base_uri, false);
if (song == NULL)
continue;
@@ -169,10 +171,17 @@ playlist_provider_print(struct client *client, const char *uri,
bool
playlist_file_print(struct client *client, const char *uri, bool detail)
{
+ GMutex *mutex = g_mutex_new();
+ GCond *cond = g_cond_new();
+
struct input_stream *is;
- struct playlist_provider *playlist = playlist_open_any(uri, &is);
- if (playlist == NULL)
+ struct playlist_provider *playlist =
+ playlist_open_any(uri, mutex, cond, &is);
+ if (playlist == NULL) {
+ g_cond_free(cond);
+ g_mutex_free(mutex);
return false;
+ }
playlist_provider_print(client, uri, playlist, detail);
playlist_plugin_close(playlist);
@@ -180,5 +189,8 @@ playlist_file_print(struct client *client, const char *uri, bool detail)
if (is != NULL)
input_stream_close(is);
+ g_cond_free(cond);
+ g_mutex_free(mutex);
+
return true;
}