if video has only one frame, frame->pts - st->last_pts will always be 0.
---
libavfilter/src_movie.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index d2aa572d12..8bbe913574 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -544,7 +544,7 @@ static int decode_packet(AVFilterContext *ctx, int i)
frame->pts += av_rescale_q_rnd(movie->ts_offset,
AV_TIME_BASE_Q, outlink->time_base, AV_ROUND_UP);
if (st->discontinuity_threshold) {
if (st->last_pts != AV_NOPTS_VALUE) {
- int64_t diff = frame->pts - st->last_pts;
+ int64_t diff = frame->pts - (st->last_pts + pkt->duration);
if (diff < 0 || diff > st->discontinuity_threshold) {
av_log(ctx, AV_LOG_VERBOSE, "Discontinuity in
stream:%d diff:%"PRId64"\n", i, diff);
movie->ts_offset += av_rescale_q_rnd(-diff,
outlink->time_base, AV_TIME_BASE_Q, AV_ROUND_UP);
--
2.43.0
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".