Skip to content

Commit

Permalink
fix: Fix cea608 whitespace rendering (#6329)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
david-hm-morgan authored and joeyparrish committed May 7, 2024
1 parent 4050614 commit f7c978e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/cea/cea608_memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,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, 'û'],
]);

Expand Down
5 changes: 3 additions & 2 deletions test/cea/cea608_memory_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,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, è, ô
},

{
Expand Down
2 changes: 1 addition & 1 deletion test/media/media_source_engine_integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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,
}),
],
Expand Down

0 comments on commit f7c978e

Please sign in to comment.