diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2014-10-20 14:25:15 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2017-08-04 20:16:46 +0300 |
commit | a4a66a03db0a84e646cf202e0847d1d2df0ed016 (patch) | |
tree | 44052b7398ca13fd508ddbe9e743d9c3f041f985 | |
parent | c4e917791d80405cc126d8f91cba845713694b2c (diff) |
matroskadec_haali: fix timeline with negative timestamps at the beginning of a segment
This can happen if a segment starts with a recovery point but not an IDR.
-rw-r--r-- | libavformat/matroskadec_haali.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/matroskadec_haali.c b/libavformat/matroskadec_haali.c index 43d850650c..ceba428dd7 100644 --- a/libavformat/matroskadec_haali.c +++ b/libavformat/matroskadec_haali.c @@ -1291,7 +1291,7 @@ static void mkv_switch_segment(AVFormatContext *s, MatroskaFile *segment, int fo #define FRAME_EOF 0x00400000 -static int mkv_packet_timeline_update(AVFormatContext *s, ulonglong *start_time, ulonglong *end_time, unsigned flags) +static int mkv_packet_timeline_update(AVFormatContext *s, longlong *start_time, longlong *end_time, unsigned flags) { MatroskaDemuxContext *ctx = (MatroskaDemuxContext *)s->priv_data; int next_timeline = 0; @@ -1301,7 +1301,7 @@ static int mkv_packet_timeline_update(AVFormatContext *s, ulonglong *start_time, if (flags & FRAME_EOF) { av_log(s, AV_LOG_INFO, "Clip EOF at timeline %d\n", ctx->timeline_position); next_timeline = 1; - } else if (!(flags & FRAME_UNKNOWN_START) && *start_time >= ctx->timeline[ctx->timeline_position].chapter->End) { + } else if (!(flags & FRAME_UNKNOWN_START) && *start_time > 0 && *start_time >= ctx->timeline[ctx->timeline_position].chapter->End) { av_log(s, AV_LOG_INFO, "Clip reached chapter boundary at %I64d at timeline %d\n", *start_time, ctx->timeline_position); next_timeline = 1; } |