From 40cee9a82cf8ef2f9c3c81171bd7a55252452a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?A=CC=81lvaro=20Velad=20Galva=CC=81n?= Date: Tue, 26 Nov 2024 10:12:27 +0100 Subject: [PATCH] fix(HLS): Ignore errors when try to detect CC --- lib/media/segment_utils.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/media/segment_utils.js b/lib/media/segment_utils.js index b2dd393f234..07e9184889d 100644 --- a/lib/media/segment_utils.js +++ b/lib/media/segment_utils.js @@ -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(); }