[FFmpeg-devel] [PATCH] avformat/mxfdec: disallow generic seek search

Marton Balint cus at passwd.hu
Tue Aug 27 02:33:26 EEST 2024


If the demuxer does not provide per-stream indexes, the generic seek search can
attempt to read the whole media file from the beginning when seeking. For large
MXF files this can cause huge lockups for a seek after the last timestamp,
which will eventually fail. So let's disable the generic seek for mxf, the
demuxer's own seek code should handle seeking just fine.

Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavformat/mxfdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index af0c8a3100..ac63c0d5ad 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -4274,7 +4274,7 @@ static const AVClass demuxer_class = {
 const FFInputFormat ff_mxf_demuxer = {
     .p.name         = "mxf",
     .p.long_name    = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format)"),
-    .p.flags        = AVFMT_SEEK_TO_PTS,
+    .p.flags        = AVFMT_SEEK_TO_PTS | AVFMT_NOGENSEARCH,
     .p.priv_class   = &demuxer_class,
     .priv_data_size = sizeof(MXFContext),
     .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
-- 
2.43.0



More information about the ffmpeg-devel mailing list