PR #25679 opened by James Almer (jamrial)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25679
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25679.patch

With the recent addition of the raw LCEVC demuxer, probing for OBU samples that 
include a Metadata OBU with an LCEVC payload, if said payload was of 
considerable size and present before a Frame Header, would result in the LCEVC 
probing function returning success before OBU could even reach a point in the 
bitstream where it may return a score.

Increase the score for OBU so it's higher than LCEVC, to remove any ambiguity.


>From e60053f2d6e8146ed52f03fd66c701be7634c78b Mon Sep 17 00:00:00 2001
From: James Almer <[email protected]>
Date: Mon, 2 Nov 2026 10:32:27 -0300
Subject: [PATCH] avformat/av1dec: increase score for OBU and retry probing as
 long as more data can be fed

With the recent addition of the raw LCEVC demuxer, probing for OBU samples that
include a Metadata OBU with an LCEVC payload, if said payload was of
considerable size and present before a Frame Header, would result in the LCEVC
probing function returning success before OBU could even reach a point in the
bitstream where it may return a score.

Signed-off-by: James Almer <[email protected]>
---
 libavformat/av1dec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/av1dec.c b/libavformat/av1dec.c
index 0a81db4ef04..4f46ace4b1d 100644
--- a/libavformat/av1dec.c
+++ b/libavformat/av1dec.c
@@ -48,7 +48,7 @@ static int get_score(int type, int *seq)
         return -1;
     case AV1_OBU_FRAME:
     case AV1_OBU_FRAME_HEADER:
-        return *seq ? AVPROBE_SCORE_EXTENSION + 1 : 0;
+        return *seq ? AVPROBE_SCORE_EXTENSION + 2 : 0;
     case AV1_OBU_METADATA:
     case AV1_OBU_PADDING:
         return -1;
@@ -368,6 +368,8 @@ static int obu_probe(const AVProbeData *p)
         ret = get_score(type, &seq);
         if (ret >= 0)
             return ret;
+        if (p->buf_size == cnt)
+            return AVERROR(EAGAIN);
     }
     return 0;
 }
-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to