From ea21a58069d823e9b12fbaed425075899c0a3834 Mon Sep 17 00:00:00 2001 From: Scott Theisen Date: Thu, 14 Nov 2024 01:26:47 -0500 Subject: [PATCH] revert lavc/dvbsub_parser.c: fix intermittent DVB subtitles disappearing Originally from: https://github.com/MythTV/mythtv/commit/6aaf617c7e1e7643039fce6e5c1e5e963376ed96 references: https://code.mythtv.org/trac/ticket/5978 I could not find the referenced FFmpeg bugs from the comment or MythTV trac since FFmpeg has changed its bug tracker. However, I did find https://samples.ffmpeg.org/ffmpeg-bugs/roundup/issue378/Issue378/ which plays back with subtitles fine. As far as I can tell the change reduces out_size by len + 6 if that section is at the end of p. However, that data is all in the buffer, so I don't see how that would fix anything. If this does actually fix something a new FFmpeg bug report should be created with a sample. --- mythtv/external/FFmpeg/libavcodec/dvbsub_parser.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mythtv/external/FFmpeg/libavcodec/dvbsub_parser.c b/mythtv/external/FFmpeg/libavcodec/dvbsub_parser.c index 1f677d94597..b2d54468677 100644 --- a/mythtv/external/FFmpeg/libavcodec/dvbsub_parser.c +++ b/mythtv/external/FFmpeg/libavcodec/dvbsub_parser.c @@ -124,11 +124,7 @@ static int dvbsub_parse(AVCodecParserContext *s, { len = AV_RB16(p + 4); - // MythTV #5978 "<=" -> "<" - // This is unresolved ffmpeg issue 378, use - // their solution if/when this is fixed upstream. - //if (len + 6 <= p_end - p) - if (len + 6 < p_end - p) + if (len + 6 <= p_end - p) { out_size += len + 6;