Commit d58b31a865 for ffmpeg
commit d58b31a865f3706a1e00bfb8071ce9afe981e48a
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Mon Oct 12 13:10:15 2026 +0000
avformat/matroskaenc: describe timestamp jumps when starting a cluster
The existing warning does not distinguish a forward timestamp outside the
Block's signed 16-bit range from a late packet that forces a backward
Cluster timestamp jump. Include the direction, stream index, incoming
timestamp, current Cluster timestamp and signed difference in milliseconds.
This addresses the diagnostic part of issue #24379. It does not change
packet interleaving or turn the condition into a muxing error.
Assisted-by: Fairy
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index f278271e24..a8408da8c1 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -3148,7 +3148,12 @@ static int mkv_write_packet_internal(AVFormatContext *s, const AVPacket *pkt)
ret = mkv_end_cluster(s);
if (ret < 0)
return ret;
- av_log(s, AV_LOG_WARNING, "Starting new cluster due to timestamp\n");
+ av_log(s, AV_LOG_WARNING,
+ "Starting new cluster due to %s timestamp jump in stream %d: "
+ "timestamp %"PRId64" ms, current cluster timestamp %"PRId64
+ " ms, delta %"PRId64" ms outside the signed 16-bit range\n",
+ cluster_time < 0 ? "backward" : "forward", pkt->stream_index,
+ ts, mkv->cluster_pts, cluster_time);
}
}