summaryrefslogtreecommitdiffstats
path: root/demux/demux_edl.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-01-05 08:43:58 +0100
committerwm4 <wm4@nowhere>2019-09-19 20:37:04 +0200
commitb230525352a8c43f00497774f81569c4ea026d6b (patch)
tree742873021da375786a53b873a835deb56fb2b490 /demux/demux_edl.c
parentb8f282fd32223057bb7db3615b0600047dd54425 (diff)
downloadmpv-b230525352a8c43f00497774f81569c4ea026d6b.tar.bz2
mpv-b230525352a8c43f00497774f81569c4ea026d6b.tar.xz
demux_edl: add a special header to disable chapter generation
A bit of a hack.
Diffstat (limited to 'demux/demux_edl.c')
-rw-r--r--demux/demux_edl.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/demux/demux_edl.c b/demux/demux_edl.c
index 98e31a79f2..882af417e7 100644
--- a/demux/demux_edl.c
+++ b/demux/demux_edl.c
@@ -45,6 +45,7 @@ struct tl_part {
};
struct tl_parts {
+ bool disable_chapters;
bool dash;
char *init_fragment_url;
struct tl_part *parts;
@@ -153,6 +154,8 @@ static struct tl_parts *parse_edl(bstr str)
struct tl_parts *ntl = talloc_zero(tl, struct tl_parts);
tl->next = ntl;
tl = ntl;
+ } else if (bstr_equals0(f_type, "no_chapters")) {
+ tl->disable_chapters = true;
} else {
goto error;
}
@@ -309,17 +312,20 @@ static void build_timeline(struct timeline *tl, struct tl_parts *parts)
}
}
- // Add a chapter between each file.
- struct demux_chapter ch = {
- .pts = starttime,
- .metadata = talloc_zero(tl, struct mp_tags),
- };
- 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
- copy_chapters(&tl->chapters, &tl->num_chapters, source, part->offset,
- part->length, starttime);
+ if (!parts->disable_chapters) {
+ // Add a chapter between each file.
+ struct demux_chapter ch = {
+ .pts = starttime,
+ .metadata = talloc_zero(tl, struct mp_tags),
+ };
+ 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
+ copy_chapters(&tl->chapters, &tl->num_chapters, source,
+ part->offset, part->length, starttime);
+ }
}
tl->parts[n] = (struct timeline_part) {