From 4e5177810d607df73c5cd756a5bec40f37981257 Mon Sep 17 00:00:00 2001 From: Adam Waldron Date: Sat, 3 Feb 2024 15:51:30 -0800 Subject: [PATCH] fix: changeType on full codec change only (#1474) --- src/source-updater.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/source-updater.js b/src/source-updater.js index c3294b725..f179e9727 100644 --- a/src/source-updater.js +++ b/src/source-updater.js @@ -275,7 +275,13 @@ const actions = { } // do not update codec if we don't need to. - if (sourceUpdater.codecs[type] === codec) { + // Only update if we change the codec base. + // For example, going from avc1.640028 to avc1.64001f does not require a changeType call. + const newCodecBase = codec.substring(0, codec.indexOf('.')); + const oldCodec = sourceUpdater.codecs[type]; + const oldCodecBase = oldCodec.substring(0, oldCodec.indexOf('.')); + + if (oldCodecBase === newCodecBase) { return; }