diff options
author | waker <wakeroid@gmail.com> | 2010-12-03 20:48:21 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2010-12-03 20:48:21 +0100 |
commit | 6a70746e903ce9d50df8a5ddabf97a2950d4788e (patch) | |
tree | b47971743dc1869942bd22e671d04bf00b1175e0 /playlist.c | |
parent | 90ffb43a8ef06c4a6c52bae195b5c8e34078a6b7 (diff) |
added new playlist plugin API
added new M3U plugin (also supports loading PLS playlists)
Diffstat (limited to 'playlist.c')
-rw-r--r-- | playlist.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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; |