Blasman via ffmpeg-devel (HE12026-04-11): > >From bfec6fbb4c8de80edc03f9dd02709a7d7beb9716 Mon Sep 17 00:00:00 2001 > From: Blasman <[email protected]> > Date: Sat, 11 Apr 2026 18:35:01 +0000 > Subject: [PATCH] Prevens ffmpeg from crashing when adding subtitles with > multiple edited out parts of video > > Band-aid fix for using Sponsorblock with subtitles. Should no longer crash > ffmpeg and instead forcibly add the subtitles to the subtitle file. > See: https://github.com/yt-dlp/yt-dlp/issues/9929 > --- > libavformat/subtitles.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/libavformat/subtitles.c b/libavformat/subtitles.c > index 69e4df88a3..bd8bfb2b6b 100644 > --- a/libavformat/subtitles.c > +++ b/libavformat/subtitles.c > @@ -289,8 +289,10 @@ int ff_subtitles_queue_seek(FFDemuxSubtitlesQueue *q, > AVFormatContext *s, int st > idx = i; > > ts_selected = q->subs[idx]->pts; > - if (ts_selected < min_ts || ts_selected > max_ts) > - return AVERROR(ERANGE); > + if (ts_selected < min_ts || ts_selected > max_ts) { > + q->current_sub_idx = idx + 1; > + return 0; > + } > > /* look back in the latest subtitles for overlapping subtitles */ > for (i = idx - 1; i >= 0; i--) {
As you say, it is a band, aid: it makes ff_subtitles_queue_seek() break its API promise in the hope that another part of the code that was using it suboptimally will land on its feet. What needs to be done is properly analyze the issue to find out exactly what part of the code is doing something wrong and fix it. And for that we need a way to reproduce the issue in FFmpeg without reading pages and pages of bug-reports about other projects. Regards, -- Nicolas George _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
