[vlc-commits] [Git][videolan/vlc][master] dav1d: fix processing for multi-message T.35 closed captions

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Nov 6 08:52:06 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
2e558721 by Rodrigo Madera at 2026-11-06T08:21:41+00:00
dav1d: fix processing for multi-message T.35 closed captions

The decoder only looked at the first T.35 message available. Since
dav1d 1.2.0 (API 6.9.0) a picture carries all the T.35 messages.

The problem became visible once !10606 made CC detection work at all.

- - - - -


1 changed file:

- modules/codec/dav1d.c


Changes:

=====================================
modules/codec/dav1d.c
=====================================
@@ -231,12 +231,28 @@ static void ExtractCaptions(decoder_t *dec, const Dav1dPicture *img)
     decoder_sys_t *p_sys = dec->p_sys;
     const struct user_data_s *userdata = (struct user_data_s *) img->m.user_data.data;
     const Dav1dITUTT35 *itu_t35 = img->itut_t35;
-    if(itu_t35 && itu_t35->country_code == 0xb5 &&
-       itu_t35->payload_size > 9 &&
-       !memcmp(itu_t35->payload, "\x00\x31GA94\x03", 7))
+
+#if DAV1D_API_VERSION_MAJOR >= 7 || \
+    (DAV1D_API_VERSION_MAJOR == 6 && DAV1D_API_VERSION_MINOR >= 9)
+    const size_t i_t35 = img->n_itut_t35;
+#else
+    const size_t i_t35 = itu_t35 ? 1 : 0;
+#endif
+
+    bool b_captions = false;
+    for(size_t i = 0; i < i_t35; i++)
     {
+        if(itu_t35[i].country_code != 0xb5 ||
+           itu_t35[i].payload_size <= 9 ||
+           memcmp(itu_t35[i].payload, "\x00\x31GA94\x03", 7))
+            continue;
         cc_Extract(&p_sys->cc, CC_PAYLOAD_GA94, true,
-                   &itu_t35->payload[7], itu_t35->payload_size - 7);
+                   &itu_t35[i].payload[7], itu_t35[i].payload_size - 7);
+        b_captions = true;
+    }
+
+    if(b_captions)
+    {
         if(p_sys->cc.b_reorder || p_sys->cc.i_data)
         {
             block_t *p_cc = block_Alloc(p_sys->cc.i_data);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2e558721665d99ecddb62147a39d455716a9c8cb

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2e558721665d99ecddb62147a39d455716a9c8cb
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list