Commit 320b671d05 for ffmpeg

commit 320b671d054410adf02778b71ba5948ca404473a
Author: Ruk Doe <info@doany.io>
Date:   Sat Oct 10 16:10:24 2026 +0900

    fate/subtitles: add libaribcaption ignore_ruby tests

    The new sample sub/aribcaption_ruby.ts (1316 bytes, synthetic) is an
    ARIB STD-B24 profile A caption stream. Small size (SSZ) text is decoded
    as a ruby region. Caption glyphs are one DRCS pattern and ruby is an
    alphanumeric character that is never drawn with ignore_ruby, so the
    results do not depend on installed fonts:

      t=2s  CS + caption
      t=3s  CS + ruby only
      t=4s  CS + ruby line above a caption line
      t=5s  ruby only, without CS

    With ignore_ruby=1, only CS clears, ruby is not drawn, and a caption
    that is all skipped ruby without CS produces no event:

      bitmap:          2s 1 rect, 3s clear, 4s 1 rect (the one caption line)
      ass, multi rect: 2s, 3s clear, 4s
      ass, single rect: same events, checked with the dialogue text so the
                        4s position comes from the caption line, not the
                        skipped ruby above it

    Before the fixes in this series, the bitmap test overflows the rects
    array at 4s, the multi rect ass test misses the 3s clear, and the single
    rect ass test has an extra 5s event and the ruby position.

    Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01DdDiDRusmi6eD7qSrKBjHb

diff --git a/tests/fate/subtitles.mak b/tests/fate/subtitles.mak
index 7dbc8b8316..060df3bb0e 100644
--- a/tests/fate/subtitles.mak
+++ b/tests/fate/subtitles.mak
@@ -180,6 +180,16 @@ FATE_SUBTITLES_ASS-$(call DEMDEC, MPEGTS, LIBARIBCAPTION) += fate-sub-aribcaptio
 fate-sub-aribcaption-clear-ass: CMD = fmtstdout ass -sub_type ass -font sans-serif -i $(TARGET_SAMPLES)/sub/aribcaption_clear.ts
 fate-sub-aribcaption-clear-text fate-sub-aribcaption-clear-ass: CMP = diff

+# caption, CS + ruby only, CS + ruby above a caption, ruby only without CS;
+# with ignore_ruby only CS must clear, and skipped ruby must not be drawn
+FATE_SUBTITLES_PROBE-$(call DEMDEC, MPEGTS, LIBARIBCAPTION) += fate-sub-aribcaption-ruby-bitmap
+fate-sub-aribcaption-ruby-bitmap: CMD = probeframes -sub_type bitmap -ignore_ruby 1 $(TARGET_SAMPLES)/sub/aribcaption_ruby.ts
+FATE_SUBTITLES_ASS-$(call DEMDEC, MPEGTS, LIBARIBCAPTION) += fate-sub-aribcaption-ruby-ass
+fate-sub-aribcaption-ruby-ass: CMD = fmtstdout ass -sub_type ass -font sans-serif -ass_single_rect 0 -ignore_ruby 1 -i $(TARGET_SAMPLES)/sub/aribcaption_ruby.ts
+FATE_SUBTITLES_ASS-$(call DEMDEC, MPEGTS, LIBARIBCAPTION) += fate-sub-aribcaption-ruby-ass-single
+fate-sub-aribcaption-ruby-ass-single: CMD = fmtstdout ass -sub_type ass -font sans-serif -ass_single_rect 1 -ignore_ruby 1 -i $(TARGET_SAMPLES)/sub/aribcaption_ruby.ts
+fate-sub-aribcaption-ruby-bitmap fate-sub-aribcaption-ruby-ass fate-sub-aribcaption-ruby-ass-single: CMP = diff
+
 FATE_SUBTITLES-$(call ENCMUX, ASS, ASS) += $(FATE_SUBTITLES_ASS-yes)
 FATE_SUBTITLES += $(FATE_SUBTITLES-yes)
 FATE_SUBTITLES := $(if $(CONFIG_PIPE_PROTOCOL), $(FATE_SUBTITLES))
diff --git a/tests/ref/fate/sub-aribcaption-ruby-ass b/tests/ref/fate/sub-aribcaption-ruby-ass
new file mode 100644
index 0000000000..135bd8d11b
--- /dev/null
+++ b/tests/ref/fate/sub-aribcaption-ruby-ass
@@ -0,0 +1,15 @@
+[Script Info]
+ScriptType: v4.00+
+PlayResX: 960
+PlayResY: 540
+WrapStyle: 2
+
+[V4+ Styles]
+Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
+Style: Default,sans-serif,36,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,4,0,4,2,10,10,10,0
+
+[Events]
+Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
+Dialogue: 0,0:00:01.00,9:59:59.99,Default,,0,0,0,,{\an7}{\pos(100,300)}{\fsp4}{\3a&Hff&}{\4a&Hff&}〓
+Dialogue: 0,0:00:02.00,9:59:59.99,Default,,0,0,0,,
+Dialogue: 0,0:00:03.00,9:59:59.99,Default,,0,0,0,,{\an7}{\pos(100,300)}{\fsp4}{\3a&Hff&}{\4a&Hff&}〓
diff --git a/tests/ref/fate/sub-aribcaption-ruby-ass-single b/tests/ref/fate/sub-aribcaption-ruby-ass-single
new file mode 100644
index 0000000000..135bd8d11b
--- /dev/null
+++ b/tests/ref/fate/sub-aribcaption-ruby-ass-single
@@ -0,0 +1,15 @@
+[Script Info]
+ScriptType: v4.00+
+PlayResX: 960
+PlayResY: 540
+WrapStyle: 2
+
+[V4+ Styles]
+Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
+Style: Default,sans-serif,36,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,4,0,4,2,10,10,10,0
+
+[Events]
+Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
+Dialogue: 0,0:00:01.00,9:59:59.99,Default,,0,0,0,,{\an7}{\pos(100,300)}{\fsp4}{\3a&Hff&}{\4a&Hff&}〓
+Dialogue: 0,0:00:02.00,9:59:59.99,Default,,0,0,0,,
+Dialogue: 0,0:00:03.00,9:59:59.99,Default,,0,0,0,,{\an7}{\pos(100,300)}{\fsp4}{\3a&Hff&}{\4a&Hff&}〓
diff --git a/tests/ref/fate/sub-aribcaption-ruby-bitmap b/tests/ref/fate/sub-aribcaption-ruby-bitmap
new file mode 100644
index 0000000000..b5ba9162b9
--- /dev/null
+++ b/tests/ref/fate/sub-aribcaption-ruby-bitmap
@@ -0,0 +1,27 @@
+[SUBTITLE]
+media_type=subtitle
+pts=2000000
+pts_time=2.000000
+format=0
+start_display_time=0
+end_display_time=4294967295
+num_rects=1
+[/SUBTITLE]
+[SUBTITLE]
+media_type=subtitle
+pts=3000000
+pts_time=3.000000
+format=0
+start_display_time=0
+end_display_time=4294967295
+num_rects=0
+[/SUBTITLE]
+[SUBTITLE]
+media_type=subtitle
+pts=4000000
+pts_time=4.000000
+format=0
+start_display_time=0
+end_display_time=4294967295
+num_rects=1
+[/SUBTITLE]