1
0
Fork 0

matroskadec_haali: fix end_time adjustment on fluid ordered chapter transitions

The end_time should not get messed with if we're doing a fluid
(non-seek) transition, as this can commonly include subtitles that go
beyond the chapter boundary
This commit is contained in:
Hendrik Leppkes 2019-03-16 13:24:00 +01:00
parent 2a8fedcc13
commit 0a0c80dcc5
Signed by: hendrik
GPG Key ID: 846079A4B0A7C1B5
1 changed files with 2 additions and 1 deletions

View File

@ -1545,7 +1545,8 @@ static int mkv_packet_timeline_update(AVFormatContext *s, longlong *start_time,
if (!(flags & (FRAME_UNKNOWN_START|FRAME_EOF))) {
*start_time -= ctx->timeline[ctx->timeline_position].offset;
if (*end_time > ctx->timeline[ctx->timeline_position].chapter->End)
// limit the end-time if we're seeking to another segment. If eg. a subtitle frame stretches over the segment boundary on a fluid transition, then just let it pass
if (*end_time > ctx->timeline[ctx->timeline_position].chapter->End && ctx->timeline_position < (ctx->num_timeline-1) && ctx->timeline[ctx->timeline_position + 1].need_seek)
*end_time = ctx->timeline[ctx->timeline_position].chapter->End;
*end_time -= ctx->timeline[ctx->timeline_position].offset;
}