From 76dc5d9aa92f5c91c728004214f7b08c3a85a5f6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 18 May 2018 22:19:10 +0200 Subject: command: make loadlist command async and abortable Don't allow it to freeze everything when loading a playlist from network (although you definitely shouldn't do that, but whatever). This also affects the really obscure --ordered-chapters-files option. The --playlist option on the other hand has no choice but to freeze the shit, because there's no concept of aborting the player during command line parsing. --- common/playlist.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common/playlist.c') diff --git a/common/playlist.c b/common/playlist.c index b2b297d671..5504b185bc 100644 --- a/common/playlist.c +++ b/common/playlist.c @@ -275,13 +275,14 @@ struct playlist_entry *playlist_entry_from_index(struct playlist *pl, int index) } } -struct playlist *playlist_parse_file(const char *file, struct mpv_global *global) +struct playlist *playlist_parse_file(const char *file, struct mp_cancel *cancel, + struct mpv_global *global) { struct mp_log *log = mp_log_new(NULL, global->log, "!playlist_parser"); mp_verbose(log, "Parsing playlist file %s...\n", file); struct demuxer_params p = {.force_format = "playlist"}; - struct demuxer *d = demux_open_url(file, &p, NULL, global); + struct demuxer *d = demux_open_url(file, &p, cancel, global); if (!d) { talloc_free(log); return NULL; -- cgit v1.2.3