From 7a7a36bcae8a243752f99004dc49640225c0f48b Mon Sep 17 00:00:00 2001 From: David HM Morgan <37144605+david-hm-morgan@users.noreply.github.com> Date: Wed, 6 Mar 2024 20:11:52 +0000 Subject: [PATCH] fix: Fix cea608 whitespace rendering (#6329) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensure whitespace rendered in CEA-608 test streams instead of `⠀` (braille pattern blank). Updated UT too, but avoiding this char at ends of the string hence vulnerable to trim() 🤦 Fixes #6328 --- lib/cea/cea608_memory.js | 2 +- test/cea/cea608_memory_unit.js | 5 +++-- test/media/media_source_engine_integration.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/cea/cea608_memory.js b/lib/cea/cea608_memory.js index 1bf125d403..a993e9d328 100644 --- a/lib/cea/cea608_memory.js +++ b/lib/cea/cea608_memory.js @@ -293,7 +293,7 @@ shaka.cea.Cea608Memory.CharSet.BasicNorthAmericanChars = new Map([ */ shaka.cea.Cea608Memory.CharSet.SpecialNorthAmericanChars = new Map([ [0x30, '®'], [0x31, '°'], [0x32, '½'], [0x33, '¿'], [0x34, '™'], [0x35, '¢'], - [0x36, '£'], [0x37, '♪'], [0x38, 'à'], [0x39, '⠀'], [0x3a, 'è'], [0x3b, 'â'], + [0x36, '£'], [0x37, '♪'], [0x38, 'à'], [0x39, ' '], [0x3a, 'è'], [0x3b, 'â'], [0x3c, 'ê'], [0x3d, 'î'], [0x3e, 'ô'], [0x3f, 'û'], ]); diff --git a/test/cea/cea608_memory_unit.js b/test/cea/cea608_memory_unit.js index 88185260fd..d9d5e11795 100644 --- a/test/cea/cea608_memory_unit.js +++ b/test/cea/cea608_memory_unit.js @@ -49,11 +49,12 @@ describe('Cea608Memory', () => { it('adds and emits a series of special characters from the buffer', () => { const startTime = 1; const endTime = 2; - const expectedText = '½¿èôÇ©ë»ö{ß│'; + const expectedText = '½¿ èôÇ©ë»ö{ß│'; const charGroups = [ { set: CharSet.SPECIAL_NORTH_AMERICAN, - chars: [0x32, 0x33, 0x3a, 0x3e], // ½, ¿, è, ô + // Note TS is not at either end to avoid side effect of trim() + chars: [0x32, 0x33, 0x39, 0x3a, 0x3e], // ½, ¿, TS, è, ô }, { diff --git a/test/media/media_source_engine_integration.js b/test/media/media_source_engine_integration.js index a007e9cc58..109dab165f 100644 --- a/test/media/media_source_engine_integration.js +++ b/test/media/media_source_engine_integration.js @@ -33,7 +33,7 @@ describe('MediaSourceEngine', () => { jasmine.objectContaining({ startTime: Util.closeTo(0.067, 0.001), endTime: Util.closeTo(1, 0.001), - payload: 'eng:⠀00:00:00:00', + payload: 'eng: 00:00:00:00', textAlign: Cue.textAlign.CENTER, }), ],