From 0499bc4375cb164989fb802ab6421692d0da8328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Tue, 26 Nov 2024 13:03:12 +0100 Subject: [PATCH] fix(HLS): Ignore errors when try to detect CC (#7668) --- 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 76b94597cb..4fd5eca1b1 100644 --- a/lib/media/segment_utils.js +++ b/lib/media/segment_utils.js @@ -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(); }