Skip to content

Commit

Permalink
fix(HLS): Ignore errors when try to detect CC (#7668)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored and joeyparrish committed Dec 11, 2024
1 parent 576daba commit 0499bc4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/media/segment_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,13 @@ shaka.media.SegmentUtils = class {
if (initData) {
captionParser.init(initData);
}
captionParser.parseFrom(data);
for (const stream of captionParser.getStreams()) {
closedCaptions.set(stream, stream);
try {
captionParser.parseFrom(data);
for (const stream of captionParser.getStreams()) {
closedCaptions.set(stream, stream);
}
} catch (e) {
shaka.log.debug('Error detecting CC streams', e);
}
captionParser.reset();
}
Expand Down

0 comments on commit 0499bc4

Please sign in to comment.