OrbiSubs SRT: treat a cue from the queue and its .vtt copy as the same across the rounding edge

The 608 was loading ~1 in 10 cues twice and running late behind the repeats.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
guy
2026-11-22 23:17:37 -03:00
parent d6a410801c
commit 575a150d7c
2 changed files with 32 additions and 1 deletions
+27
View File
@@ -75,6 +75,33 @@ class Juntar(unittest.TestCase):
self.assertIn((0x11, 0x40 + 0x10 + ((32 - len("¿Y por qué Estoy nerviosa.")) // 2 // 4) * 2), pares)
class Repetidos(unittest.TestCase):
"""El mismo cue por la cola (float) y por el .vtt (ms), en el borde del redondeo (2026-11-23)."""
REAL = [(37637.814622, 37641.094622, "para garantizar la seguridad, confiabilidad y transparencia del"),
(37640.984622, 37643.914622, "sistema informático que se utilizará durante las"),
(37644.094622, 37646.874622, "elecciones seccionales y del Consejo de Participación")]
def test_vtt_en_el_borde_no_entra_dos_veces(self):
for E in (lambda: S.Enc608(1), lambda: S.Enc708(1)):
e = E()
for c in self.REAL:
e.agregar(c, 37630)
e.agregar((round(c[0], 3) + 0.0004, round(c[1], 3), c[2]), 37630) # como lo da el .vtt
self.assertEqual(len(e.cola), 3)
def test_608_sin_tarde_con_cola_y_vtt(self):
cues = self.REAL + [(round(c[0], 3) + 0.0004, round(c[1], 3), c[2]) for c in self.REAL]
e, mostrados = correr(cues, 37630, 37648)
self.assertEqual(e.st["tarde"], 0)
self.assertEqual(len(mostrados), 3)
def test_mismo_texto_otro_momento_si_entra(self):
e = S.Enc608(1)
e.agregar((100.0, 101.0, "Gracias."), 90)
e.agregar((100.5, 101.5, "Gracias."), 90)
self.assertEqual(len(e.cola), 2)
class Reloj(unittest.TestCase):
def test_vuelta_del_pcr(self):
# 094: el PCR dio la vuelta dentro de un segmento (ecuadortv 2026-11-21 13:02).