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

The base layer of the stream should be decodable.


>From 4ad56bcff24b77f098c5f20e5020f61bfbc59b99 Mon Sep 17 00:00:00 2001
From: James Almer <[email protected]>
Date: Fri, 27 Nov 2026 19:20:47 -0300
Subject: [PATCH] avocdec/vvc/dec: don't return an error on NALs with layer id
 > 0

The base layer of the stream should be decodable.

Signed-off-by: James Almer <[email protected]>
---
 libavcodec/vvc/dec.c | 9 ++++++---
 libavcodec/vvc/dec.h | 1 +
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c
index b2dcc853ac5..3f4d777c867 100644
--- a/libavcodec/vvc/dec.c
+++ b/libavcodec/vvc/dec.c
@@ -1013,9 +1013,12 @@ static int decode_nal_unit(VVCContext *s, 
VVCFrameContext *fc, AVBufferRef *buf_
     s->temporal_id = nal->temporal_id;
 
     if (nal->nuh_layer_id > 0) {
-        avpriv_report_missing_feature(fc->log_ctx,
-                "Decoding of multilayer bitstreams");
-        return AVERROR_PATCHWELCOME;
+        if (!s->multilayer_warning_shown) {
+            avpriv_report_missing_feature(fc->log_ctx,
+                    "Decoding of multilayer bitstreams");
+            s->multilayer_warning_shown = 1;
+        }
+        return 0;
     }
 
     switch (unit->type) {
diff --git a/libavcodec/vvc/dec.h b/libavcodec/vvc/dec.h
index 7ea88c19f45..0b30240a04c 100644
--- a/libavcodec/vvc/dec.h
+++ b/libavcodec/vvc/dec.h
@@ -234,6 +234,7 @@ typedef struct VVCContext {
     int no_output_before_recovery_flag; ///< NoOutputBeforeRecoveryFlag
     int gdr_recovery_point_poc;         ///< recoveryPointPocVal
     int film_grain_warning_shown;
+    int multilayer_warning_shown;
 
     /**
      * Sequence counters for decoded and output frames, so that old
-- 
2.54.1

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

Reply via email to