aboutsummaryrefslogtreecommitdiff
path: root/src/playlist_queue.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-03 21:08:48 +0100
committerMax Kellermann <max@duempel.org>2011-01-10 19:46:23 +0100
commitb6995ca0113611613d311250eabfc354658d46a7 (patch)
tree713bff7fe8b8dcbd48b2ea67f95e3ec9e018104b /src/playlist_queue.c
parent715844fd089d3baf17d7080b47434fca8fb60b1d (diff)
player_control: removed the global variable "pc"
Allocate a player_control object where needed, and pass it around. Each "client" object is associated with a "player_control" instance. This prepares multi-player support.
Diffstat (limited to 'src/playlist_queue.c')
-rw-r--r--src/playlist_queue.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/playlist_queue.c b/src/playlist_queue.c
index 43621da9..e0730fd0 100644
--- a/src/playlist_queue.c
+++ b/src/playlist_queue.c
@@ -27,7 +27,8 @@
enum playlist_result
playlist_load_into_queue(const char *uri, struct playlist_provider *source,
- struct playlist *dest, bool secure)
+ struct playlist *dest, struct player_control *pc,
+ bool secure)
{
enum playlist_result result;
struct song *song;
@@ -38,7 +39,7 @@ playlist_load_into_queue(const char *uri, struct playlist_provider *source,
if (song == NULL)
continue;
- result = playlist_append_song(dest, song, NULL);
+ result = playlist_append_song(dest, pc, song, NULL);
if (result != PLAYLIST_RESULT_SUCCESS) {
if (!song_in_database(song))
song_free(song);
@@ -53,7 +54,9 @@ playlist_load_into_queue(const char *uri, struct playlist_provider *source,
}
enum playlist_result
-playlist_open_into_queue(const char *uri, struct playlist *dest, bool secure)
+playlist_open_into_queue(const char *uri,
+ struct playlist *dest, struct player_control *pc,
+ bool secure)
{
struct input_stream *is;
struct playlist_provider *playlist = playlist_open_any(uri, &is);
@@ -61,7 +64,7 @@ playlist_open_into_queue(const char *uri, struct playlist *dest, bool secure)
return PLAYLIST_RESULT_NO_SUCH_LIST;
enum playlist_result result =
- playlist_load_into_queue(uri, playlist, dest, secure);
+ playlist_load_into_queue(uri, playlist, dest, pc, secure);
playlist_plugin_close(playlist);
if (is != NULL)