diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-10-27 16:45:14 +0100 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-10-27 16:45:14 +0100 |
commit | 9191ec6d460eca9078e4c31c8f38cbb68c5ade7d (patch) | |
tree | 4ed77df6c6a620daa284fd0f1e7b3c91ae318992 /plugins/m3u | |
parent | cd55b2407f2709197921b3340b5789337928b537 (diff) |
m3u: don't save subtracks to pls/m3u
Diffstat (limited to 'plugins/m3u')
-rw-r--r-- | plugins/m3u/m3u.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/m3u/m3u.c b/plugins/m3u/m3u.c index 6b5ddd03..5299b7c5 100644 --- a/plugins/m3u/m3u.c +++ b/plugins/m3u/m3u.c @@ -489,6 +489,14 @@ m3uplug_save_m3u (const char *fname, DB_playItem_t *first, DB_playItem_t *last) deadbeef->pl_item_ref (it); fprintf (fp, "#EXTM3U\n"); while (it) { + // skip subtracks, pls and m3u formats don't support that + uint32_t flags = deadbeef->pl_get_item_flags (it); + if (flags & DDB_IS_SUBTRACK) { + DB_playItem_t *next = deadbeef->pl_get_next (it, PL_MAIN); + deadbeef->pl_item_unref (it); + it = next; + continue; + } int dur = (int)ceil(deadbeef->pl_get_item_duration (it)); char s[1000]; if (deadbeef->pl_meta_exists (it, "artist")) { @@ -527,6 +535,14 @@ m3uplug_save_pls (const char *fname, DB_playItem_t *first, DB_playItem_t *last) DB_playItem_t *it = first; deadbeef->pl_item_ref (it); while (it) { + // skip subtracks, pls and m3u formats don't support that + uint32_t flags = deadbeef->pl_get_item_flags (it); + if (flags & DDB_IS_SUBTRACK) { + DB_playItem_t *next = deadbeef->pl_get_next (it, PL_MAIN); + deadbeef->pl_item_unref (it); + it = next; + continue; + } n++; if (it == last) { break; @@ -543,6 +559,14 @@ m3uplug_save_pls (const char *fname, DB_playItem_t *first, DB_playItem_t *last) deadbeef->pl_item_ref (it); int i = 1; while (it) { + // skip subtracks, pls and m3u formats don't support that + uint32_t flags = deadbeef->pl_get_item_flags (it); + if (flags & DDB_IS_SUBTRACK) { + DB_playItem_t *next = deadbeef->pl_get_next (it, PL_MAIN); + deadbeef->pl_item_unref (it); + it = next; + continue; + } deadbeef->pl_lock (); { const char *fname = deadbeef->pl_find_meta (it, ":URI"); |