From 31de4f61625e722fe9817a91adf119dd6cf95300 Mon Sep 17 00:00:00 2001 From: Daniel Silhavy Date: Fri, 29 Nov 2024 17:47:01 +0100 Subject: [PATCH] Fix/filtering (#4637) * Fix an issue that causes DRM capabilities being compared to non DRM capabilities * Fix an issue with WebM SegmentBase streams and Annex I handling * Add Shaka teststream to smoke vector list --- src/dash/WebmSegmentBaseLoader.js | 3 ++- .../controllers/ExtUrlQueryInfoController.js | 6 +++++- src/streaming/utils/Capabilities.js | 20 ++++++++++++++++--- .../test-configurations/streams/smoke.json | 15 ++++++++++++++ 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/dash/WebmSegmentBaseLoader.js b/src/dash/WebmSegmentBaseLoader.js index 80f7f99c8f..7521f8803b 100644 --- a/src/dash/WebmSegmentBaseLoader.js +++ b/src/dash/WebmSegmentBaseLoader.js @@ -344,7 +344,8 @@ function WebmSegmentBaseLoader() { request: request, url: media, init: false, - mediaType: mediaType + mediaType: mediaType, + representation }; request = _getFragmentRequest(info); diff --git a/src/streaming/controllers/ExtUrlQueryInfoController.js b/src/streaming/controllers/ExtUrlQueryInfoController.js index 1a026c81d1..a1c39b80ba 100644 --- a/src/streaming/controllers/ExtUrlQueryInfoController.js +++ b/src/streaming/controllers/ExtUrlQueryInfoController.js @@ -154,10 +154,14 @@ function ExtUrlQueryInfoController() { function getFinalQueryString(request) { try { if (!mpdQueryStringInformation) { - return + return null; } if (request.type === HTTPRequest.MEDIA_SEGMENT_TYPE || request.type === HTTPRequest.INIT_SEGMENT_TYPE) { const representation = request.representation; + + if (!representation) { + return null; + } const adaptation = representation.adaptation; const period = adaptation.period; const queryInfo = mpdQueryStringInformation diff --git a/src/streaming/utils/Capabilities.js b/src/streaming/utils/Capabilities.js index 5aa7204cab..df5bdb9f9f 100644 --- a/src/streaming/utils/Capabilities.js +++ b/src/streaming/utils/Capabilities.js @@ -344,13 +344,27 @@ function Capabilities() { } return testedCodecConfigurations.find((current) => { - const audioEqual = configuration && configuration.audio ? objectUtils.areEqual(configuration.audio, current.audio) : true; - const videoEqual = configuration && configuration.video ? objectUtils.areEqual(configuration.video, current.video) : true; - const keySystemEqual = configuration && configuration.keySystemConfiguration ? objectUtils.areEqual(configuration.keySystemConfiguration, current.keySystemConfiguration) : true; + const audioEqual = _isConfigEqual(configuration, current, Constants.AUDIO); + const videoEqual = _isConfigEqual(configuration, current, Constants.VIDEO); + const keySystemEqual = _isConfigEqual(configuration, current, 'keySystemConfiguration'); return audioEqual && videoEqual && keySystemEqual }) + } + + function _isConfigEqual(configuration, current, attribute) { + + // Config not present in both of them + if (!configuration[attribute] && !current[attribute]) { + return true + } + + // Config present in both we need to compare + if (configuration[attribute] && current[attribute]) { + return objectUtils.areEqual(configuration[attribute], current[attribute]) + } + return false } function _getGenericMediaCapabilitiesVideoConfig(inputConfig) { diff --git a/test/functional/config/test-configurations/streams/smoke.json b/test/functional/config/test-configurations/streams/smoke.json index 1c808186d6..6b029faf7e 100644 --- a/test/functional/config/test-configurations/streams/smoke.json +++ b/test/functional/config/test-configurations/streams/smoke.json @@ -55,6 +55,21 @@ } ] }, + { + "name": "Shaka Demo Assets: Angel-One Widevine", + "type": "vod", + "url": "https://storage.googleapis.com/shaka-demo-assets/angel-one-widevine/dash.mpd", + "drm": { + "com.widevine.alpha": { + "serverURL": "https://cwip-shaka-proxy.appspot.com/no_auth" + } + }, + "excludedPlatforms": [ + { + "browser": "safari" + } + ] + }, { "name": "1080p with PlayReady and Widevine DRM, single key", "type": "vod",