1
mirror of https://github.com/mpv-player/mpv synced 2024-10-22 08:51:57 +02:00

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.
This commit is contained in:
Ben Boeckel 2015-01-25 19:35:36 -05:00 committed by wm4
parent aa9347883f
commit c9558e560e

View File

@ -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);
}