From 90f68f7b2d2c215e98cea1d955fb37605ae89585 Mon Sep 17 00:00:00 2001 From: Marton Balint Date: Tue, 27 Aug 2024 01:08:33 +0200 Subject: [PATCH] avformat/mxfdec: disallow generic seek search 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 --- 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,