Skip to content

Commit

Permalink
fix: Use "undetermined" for missing CC language
Browse files Browse the repository at this point in the history
When caption languages are not present in the manifest (such as
"CC2=;CC3="), use "und", the language code for "undetermined".

Bug: 187442669
Change-Id: Ia129815efb2ae6b0ac6b655ac02398a7b1f70e68
  • Loading branch information
joeyparrish committed Jul 19, 2021
1 parent 7a3e8e0 commit 3cc9ec5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/dash/dash_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,9 @@ shaka.dash.DashParser = class {
channel = channelAndLanguage[0].startsWith('CC') ?
channelAndLanguage[0] : `CC${channelAndLanguage[0]}`;

language = channelAndLanguage[1]; // 3 letters (ISO 639-2)
// 3 letters (ISO 639-2). In b/187442669, we saw a blank string
// (CC2=;CC3=), so default to "und" (the code for "undetermined").
language = channelAndLanguage[1] || 'und';
}
closedCaptions.set(channel, LanguageUtils.normalize(language));
}
Expand Down

0 comments on commit 3cc9ec5

Please sign in to comment.