diff options
author | sfan5 <sfan5@live.de> | 2018-07-31 19:46:19 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2018-08-13 19:09:57 +0200 |
commit | 2e7f60c38691fddfa67da07ac5ca2ad15dc84097 (patch) | |
tree | 082b06d06e8cd694ba63f37eeef060a9577c948f /demux/demux_edl.c | |
parent | d5cad856255cb0e74461f9d6613f561c6f347a0f (diff) | |
download | mpv-2e7f60c38691fddfa67da07ac5ca2ad15dc84097.tar.bz2 mpv-2e7f60c38691fddfa67da07ac5ca2ad15dc84097.tar.xz |
demux_edl: add title option to override title of chapters
Diffstat (limited to 'demux/demux_edl.c')
-rw-r--r-- | demux/demux_edl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/demux/demux_edl.c b/demux/demux_edl.c index 36a9c2cc3b..b724ffa592 100644 --- a/demux/demux_edl.c +++ b/demux/demux_edl.c @@ -41,6 +41,7 @@ struct tl_part { bool offset_set; bool chapter_ts; double length; // length of the part (-1 if rest of the file) + char *title; }; struct tl_parts { @@ -123,6 +124,8 @@ static struct tl_parts *parse_edl(bstr str) } else if (bstr_equals0(name, "timestamps")) { if (bstr_equals0(val, "chapters")) p.chapter_ts = true; + } else if (bstr_equals0(name, "title")) { + p.title = bstrto0(tl, val); } if (nparam >= MAX_PARAMS) goto error; @@ -296,7 +299,7 @@ static void build_timeline(struct timeline *tl, struct tl_parts *parts) .pts = starttime, .metadata = talloc_zero(tl, struct mp_tags), }; - mp_tags_set_str(ch.metadata, "title", part->filename); + mp_tags_set_str(ch.metadata, "title", part->title ? part->title : part->filename); MP_TARRAY_APPEND(tl, tl->chapters, tl->num_chapters, ch); // Also copy the source file's chapters for the relevant parts |