diff options
author | Ben Boeckel <mathstuf@gmail.com> | 2015-01-25 19:35:36 -0500 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-02-06 11:55:16 +0100 |
commit | c9558e560eaead8ef3d73c8a3e4cdb5c4ffbfef4 (patch) | |
tree | d16e21887f175c4a00da7c22c5ed496d5f78bac2 /player/timeline/tl_matroska.c | |
parent | aa9347883f37b2c5b0bdb321953b7f70763c20a0 (diff) | |
download | mpv-c9558e560eaead8ef3d73c8a3e4cdb5c4ffbfef4.tar.bz2 mpv-c9558e560eaead8ef3d73c8a3e4cdb5c4ffbfef4.tar.xz |
tl_matroska: only check the chapter count when adding chapters
Fixes #1445 without failing in the case where file outside.mkv with N
chapters references inside.mkv with N+1 chapters. Since we don't care
about the number of chapters in inner files (yet; nested chapters would
change this, but also make chapters dynamic anyways), don't check there.
Diffstat (limited to 'player/timeline/tl_matroska.c')
-rw-r--r-- | player/timeline/tl_matroska.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/player/timeline/tl_matroska.c b/player/timeline/tl_matroska.c index 8727c8c72a..17734d0363 100644 --- a/player/timeline/tl_matroska.c +++ b/player/timeline/tl_matroska.c @@ -396,10 +396,10 @@ static void build_timeline_loop(struct MPContext *mpctx, if (!demux_matroska_uid_cmp(&c->uid, &linked_m->uid)) continue; - if (i >= ctx->num_chapters) - break; // probably needed only for broken sources - if (!info->limit) { + if (i >= ctx->num_chapters) + break; // malformed files can cause this to happen. + chapters[i].pts = ctx->start_time / 1e9; chapters[i].name = talloc_strdup(chapters, c->name); } |