From d585382f0ef9cf6c8e5e481bb2f4f18a30feca59 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 21 Nov 2013 15:59:00 +0100 Subject: timeline: reject mplayer2 EDL files, change EDL header This was forgotten when the parser for mplayer2 EDL files was removed. Change the header of the mpv EDL format to include a '#', so a naive parser could skip the header as comment. (Maybe this is questionable; on the other hand, if it can be simpler, why not.) Also, strip the header in demux_edl.c before passing on the data, so the header check doesn't need to be duplicated in tl_mpv_edl.c. --- mpvcore/player/mp_core.h | 2 -- mpvcore/player/timeline/tl_mpv_edl.c | 6 ++---- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'mpvcore') diff --git a/mpvcore/player/mp_core.h b/mpvcore/player/mp_core.h index 2ea65f54be..4e15f49c49 100644 --- a/mpvcore/player/mp_core.h +++ b/mpvcore/player/mp_core.h @@ -428,8 +428,6 @@ void update_subtitles(struct MPContext *mpctx); void build_ordered_chapter_timeline(struct MPContext *mpctx); // timeline/tl_mpv_edl.c void build_mpv_edl_timeline(struct MPContext *mpctx); -// timeline/tl_edl.c -void build_edl_timeline(struct MPContext *mpctx); // timeline/tl_cue.c void build_cue_timeline(struct MPContext *mpctx); diff --git a/mpvcore/player/timeline/tl_mpv_edl.c b/mpvcore/player/timeline/tl_mpv_edl.c index 1f4bbc268e..fc0b6ebeeb 100644 --- a/mpvcore/player/timeline/tl_mpv_edl.c +++ b/mpvcore/player/timeline/tl_mpv_edl.c @@ -56,16 +56,14 @@ static bool parse_time(bstr str, double *out_time) } /* Returns a list of parts, or NULL on parse error. - * Syntax: - * url ::= ['edl://'|'mpv EDL v0\n'] ( (';' | '\n') )* + * Syntax (without file header or URI prefix): + * url ::= ( (';' | '\n') )* * entry ::= ( ',' )* * param ::= [ '='] ( | '%' '%' ) */ static struct tl_parts *parse_edl(bstr str) { struct tl_parts *tl = talloc_zero(NULL, struct tl_parts); - if (!bstr_eatstart0(&str, "edl://")) - bstr_eatstart0(&str, "mpv EDL v0\n"); while (str.len) { if (bstr_eatstart0(&str, "#")) bstr_split_tok(str, "\n", &(bstr){0}, &str); -- cgit v1.2.3