[vlc-commits] [Git][videolan/vlc][master] 2 commits: codec/cc: Fix garbled DVD CEA-608 captions with large cc_counts

Tristan Matthews (@tmatth) gitlab at videolan.org
Thu Jun 5 15:49:44 UTC 2025



Tristan Matthews pushed to branch master at VideoLAN / VLC


Commits:
067b9da0 by Devin Heitmueller at 2025-06-05T15:31:51+00:00
codec/cc: Fix garbled DVD CEA-608 captions with large cc_counts

The GOP parser for captions when found in DVD GOPs had an error
when determining the CC count, which excluded the top bit (i.e.
only using the lower four bits of a five bit field).  Thus
it would work properly if the cc_count was less than 16, but would
lose the rest of the captions in the GOP.

Parse all five bits of the field.

Signed-off-by: Devin Heitmueller <dheitmueller at ltnglobal.com>

- - - - -
778d9d25 by Devin Heitmueller at 2025-06-05T15:31:51+00:00
codec/cc: Fix lost CEA-608 pair for DVD captions with truncate flag

If parsing GOP based captions, the truncate field wasn't being
properly respected, resulting in the last pair being lost if the
flag was set.  This would cause intermittent caption bytes to be
missing (e.g. missing characters in rendered captions).

Correct the logic so that the last pair isn't lost, by comparing
the code against the original ccextractor code it was based on.

Tested with "Sports Night", season 1, disc 1.

Signed-off-by: Devin Heitmueller <dheitmueller at ltnglobal.com>

- - - - -


1 changed file:

- modules/codec/cc.h


Changes:

=====================================
modules/codec/cc.h
=====================================
@@ -299,7 +299,7 @@ static inline void cc_Extract( cc_data_t *c, enum cc_payload_type_e i_payload_ty
          */
         const int b_truncate = p_src[4] & 0x01;
         const int i_field_first = (p_src[4] & 0x80) ? 0 : 1;
-        const int i_count_cc2 = (p_src[4] >> 1) & 0xf;
+        const int i_count_cc2 = ((p_src[4] >> 1) & 0x1f) + b_truncate;
         const uint8_t *cc = &p_src[5];
         int i;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b6abafe591117493148655b63256a65cf9616433...778d9d254ebc5da7f40ecd7ccccd66fc99adc27b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b6abafe591117493148655b63256a65cf9616433...778d9d254ebc5da7f40ecd7ccccd66fc99adc27b
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list