diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index cb31d6aed7..4471858222 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2398,9 +2398,9 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) vs->duration = (double)(pkt->pts - vs->end_pts) * st->time_base.num / st->time_base.den; } } - } + can_split = can_split && (pkt->pts - vs->end_pts > 0); if (vs->packets_written && can_split && av_compare_ts(pkt->pts - vs->start_pts, st->time_base, end_pts, AV_TIME_BASE_Q) >= 0) { int64_t new_start_pos;