summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2010-12-03 20:48:21 +0100
committerGravatar waker <wakeroid@gmail.com>2010-12-03 20:48:21 +0100
commit6a70746e903ce9d50df8a5ddabf97a2950d4788e (patch)
treeb47971743dc1869942bd22e671d04bf00b1175e0 /playlist.c
parent90ffb43a8ef06c4a6c52bae195b5c8e34078a6b7 (diff)
added new playlist plugin API
added new M3U plugin (also supports loading PLS playlists)
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/playlist.c b/playlist.c
index 23c55650..cf8d259a 100644
--- a/playlist.c
+++ b/playlist.c
@@ -2090,6 +2090,26 @@ pl_load (const char *fname) {
}
GLOBAL_LOCK;
pl_clear ();
+
+ // try plugins 1st
+ const char *ext = strrchr (fname, '.');
+ if (ext) {
+ ext++;
+ DB_playlist_t **plug = plug_get_playlist_list ();
+ int p, e;
+ for (p = 0; plug[p]; p++) {
+ for (e = 0; plug[p]->extensions[e]; e++) {
+ if (plug[p]->load && !strcasecmp (ext, plug[p]->extensions[e])) {
+ DB_playItem_t *it = plug[p]->load (it, fname, NULL, NULL, NULL);
+ if (it) {
+ GLOBAL_UNLOCK;
+ return 0;
+ }
+ }
+ }
+ }
+ }
+
uint8_t majorver;
uint8_t minorver;
playItem_t *it = NULL;