summaryrefslogtreecommitdiffstats
path: root/core/playlist.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-27 18:21:07 +0200
committerwm4 <wm4@nowhere>2013-06-28 15:47:35 +0200
commit5f664d78e6e9bd5809dc7d0f12c4099e76582cb3 (patch)
tree618ad84b255a8f99afbb196a71d0d29eec90faac /core/playlist.c
parentac79eb733741d8d22bbd550be39fe63c28a575f9 (diff)
downloadmpv-5f664d78e6e9bd5809dc7d0f12c4099e76582cb3.tar.bz2
mpv-5f664d78e6e9bd5809dc7d0f12c4099e76582cb3.tar.xz
core: add libquvi 0.9 support
This adds support for libquvi 0.9.x, and these features: - start time (part of youtube URL) - youtube subtitles - alternative source switching ('l' and 'L' keys) - youtube playlists Note that libquvi 0.9 is still in development. Although this seems to be API stable now, it looks like there will be a 1.0 release, which is supposed to be the next stable release and the actual successor of libquvi 0.4.x.
Diffstat (limited to 'core/playlist.c')
-rw-r--r--core/playlist.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/core/playlist.c b/core/playlist.c
index 5456931afa..7188392bc6 100644
--- a/core/playlist.c
+++ b/core/playlist.c
@@ -180,13 +180,19 @@ void playlist_add_base_path(struct playlist *pl, bstr base_path)
}
}
-// Move all entries from source_pl to pl, appending them at the end of pl.
-// source_pl will be empty, and all entries have changed ownership to pl.
+// Move all entries from source_pl to pl, appending them after the current entry
+// of pl. source_pl will be empty, and all entries have changed ownership to pl.
void playlist_transfer_entries(struct playlist *pl, struct playlist *source_pl)
{
+ struct playlist_entry *add_after = pl->current;
+ if (pl->current && pl->current_was_replaced)
+ add_after = pl->current->next;
+ if (!add_after)
+ add_after = pl->last;
+
while (source_pl->first) {
struct playlist_entry *e = source_pl->first;
playlist_unlink(source_pl, e);
- playlist_add(pl, e);
+ playlist_insert(pl, add_after, e);
}
}