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 Nov 26, 2024
1 parent 4aa9306 commit 5be0fc4
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 @@ -417,9 +417,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 5be0fc4

Please sign in to comment.