[FFmpeg-devel] [PATCH 01/24] lavf/mux: do not apply max_interleave_delta to subtitles

Anton Khirnov anton at khirnov.net
Sat Nov 4 09:56:10 EET 2023


It is common for subtitle streams to have large gaps between packets.
When the caller is interleaving packets from multiple files, it can
easily happen that two successive subtitle packets trigger this limit,
even though no excessive buffering is happening.
---
 libavformat/mux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index c7877c5d98..de10d2c008 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -995,7 +995,7 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *pkt,
             const PacketListEntry *const last = sti->last_in_packet_buffer;
             int64_t last_dts;
 
-            if (!last)
+            if (!last || st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE)
                 continue;
 
             last_dts = av_rescale_q(last->pkt.dts,
-- 
2.42.0



More information about the ffmpeg-devel mailing list