[FFmpeg-cvslog] avcodec/libdav1d: support parsing multiple ITU-T T.35 entries in a picture

James Almer git at videolan.org
Fri May 5 20:27:00 EEST 2023


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Apr 18 21:07:29 2023 -0300| [09b2ca93b4aa7cb24eeebdc829be61077466f021] | committer: James Almer

avcodec/libdav1d: support parsing multiple ITU-T T.35 entries in a picture

This requires the newest libdav1d release.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=09b2ca93b4aa7cb24eeebdc829be61077466f021
---

 libavcodec/libdav1d.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 87aed16749..af072da681 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -514,10 +514,16 @@ FF_ENABLE_DEPRECATION_WARNINGS
         light->MaxFALL = p->content_light->max_frame_average_light_level;
     }
     if (p->itut_t35) {
+#if FF_DAV1D_VERSION_AT_LEAST(6,9)
+        for (size_t i = 0; i < p->n_itut_t35; i++) {
+            const Dav1dITUTT35 *itut_t35 = &p->itut_t35[i];
+#else
+        const Dav1dITUTT35 *itut_t35 = p->itut_t35;
+#endif
         GetByteContext gb;
         int provider_code;
 
-        bytestream2_init(&gb, p->itut_t35->payload, p->itut_t35->payload_size);
+        bytestream2_init(&gb, itut_t35->payload, itut_t35->payload_size);
 
         provider_code = bytestream2_get_be16(&gb);
         switch (provider_code) {
@@ -549,7 +555,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
             int provider_oriented_code = bytestream2_get_be16(&gb);
             int application_identifier = bytestream2_get_byte(&gb);
 
-            if (p->itut_t35->country_code != 0xB5 ||
+            if (itut_t35->country_code != 0xB5 ||
                 provider_oriented_code != 1 || application_identifier != 4)
                 break;
 
@@ -568,6 +574,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
         default: // ignore unsupported provider codes
             break;
         }
+#if FF_DAV1D_VERSION_AT_LEAST(6,9)
+        }
+#endif
     }
     if (p->frame_hdr->film_grain.present && (!dav1d->apply_grain ||
         (c->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN))) {



More information about the ffmpeg-cvslog mailing list