[FFmpeg-devel] [PATCH 21/22] avcodec/libsvtav1: raise strictness of missing DV error

Niklas Haas ffmpeg at haasn.xyz
Sun Jul 28 13:25:26 EEST 2024


From: Niklas Haas <git at haasn.dev>

While this is technically a spec violation, the result is still
decodable (and will look perfectly fine to clients ignoring Dolby Vision
metadata). It will also only happen in garbage in, garbage out scenarios.
---
 libavcodec/libsvtav1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index e7b12fb488..4c91750fbe 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -551,10 +551,10 @@ static int eb_send_frame(AVCodecContext *avctx, const AVFrame *frame)
     } else if (svt_enc->dovi.cfg.dv_profile) {
         av_log(avctx, AV_LOG_ERROR, "Dolby Vision enabled, but received frame "
                "without AV_FRAME_DATA_DOVI_METADATA\n");
-        return AVERROR_INVALIDDATA;
+        if (avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT)
+            return AVERROR_INVALIDDATA;
     }
 
-
     svt_ret = svt_av1_enc_send_picture(svt_enc->svt_handle, headerPtr);
     if (svt_ret != EB_ErrorNone)
         return svt_print_error(avctx, svt_ret, "Error sending a frame to encoder");
-- 
2.45.2



More information about the ffmpeg-devel mailing list