mirror of
https://github.com/mpv-player/mpv
synced 2025-03-22 11:18:32 +00: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:
parent
aa9347883f
commit
c9558e560e
@ -396,10 +396,10 @@ static void build_timeline_loop(struct MPContext *mpctx,
|
|||||||
if (!demux_matroska_uid_cmp(&c->uid, &linked_m->uid))
|
if (!demux_matroska_uid_cmp(&c->uid, &linked_m->uid))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (i >= ctx->num_chapters)
|
|
||||||
break; // probably needed only for broken sources
|
|
||||||
|
|
||||||
if (!info->limit) {
|
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].pts = ctx->start_time / 1e9;
|
||||||
chapters[i].name = talloc_strdup(chapters, c->name);
|
chapters[i].name = talloc_strdup(chapters, c->name);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user