Skip to content

Commit

Permalink
fix(HLS): Ignore errors when try to detect CC
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Nov 26, 2024
1 parent 79b1536 commit 40cee9a
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) {
// Ignore errors
}
captionParser.reset();
}
Expand Down

0 comments on commit 40cee9a

Please sign in to comment.