Skip to content

Commit b7d215e

Browse files
authored
fix: Allow enhancement codecs to be re-tested in Capabilities.js if Settings change (#4894)
Remove enhancement codecs from tested configurations so that they can be re-tested if the enhancement settings change. This PR aims to fix a minor issue that we are seeing in the Reference Player, if a stream is loaded, and afterwards the Enhancement Layer is enabled, enhancement codecs would still be filtered out due to them being in the testedCodecConfigurations. This PR removes them out from testedCodecConfigurations so they can be re-tested on next stream load.
1 parent 0f922f4 commit b7d215e

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/streaming/utils/Capabilities.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,11 @@ function Capabilities() {
138138
return Promise.resolve();
139139
}
140140

141-
const enhancementCodecs = settings.get().streaming.enhancement.codecs;
142-
if (settings.get().streaming.enhancement.enabled && enhancementCodecs.some(cdc => basicConfiguration.codec.includes(cdc))) {
141+
if (settings.get().streaming.enhancement.enabled && _isEnhancementCodec(basicConfiguration.codec)) {
142+
// Remove enhancement codecs from tested configurations so that they can be re-tested if the enhancement settings change
143+
testedCodecConfigurations = testedCodecConfigurations.filter((configuration) => {
144+
return !_isEnhancementCodec(configuration.mediaSourceCodecString);
145+
});
143146
return Promise.resolve(true);
144147
}
145148

@@ -355,6 +358,18 @@ function Capabilities() {
355358
})
356359
}
357360

361+
/**
362+
* Check if codec is an enhancement layer codec, e.g. LCEVC
363+
* Enhancement layer codecs can be configured via settings.
364+
* @param {string} codec
365+
* @return {boolean} true if enhancement codec
366+
* @private
367+
*/
368+
function _isEnhancementCodec(codec) {
369+
const enhancementCodecs = settings.get().streaming.enhancement.codecs;
370+
return enhancementCodecs.some((c) => codec.includes(c));
371+
}
372+
358373
function _isConfigSupported(testedConfigurations) {
359374
return testedConfigurations.some((testedConfiguration) => {
360375
return testedConfiguration && testedConfiguration.decodingInfo && testedConfiguration.decodingInfo.supported

0 commit comments

Comments
 (0)