From a096bc1452d48c8cbcc250b960d7bd8f79f1a83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Mon, 17 May 2021 23:01:11 +0200 Subject: [PATCH] fix:Filter unsupported H.264 streams in Xbox (#3411) --- lib/util/stream_utils.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/util/stream_utils.js b/lib/util/stream_utils.js index 3333d155fc..3822fc57f3 100644 --- a/lib/util/stream_utils.js +++ b/lib/util/stream_utils.js @@ -410,6 +410,17 @@ shaka.util.StreamUtils = class { await shaka.util.StreamUtils.getDecodingInfosForVariants( manifest.variants, usePersistentLicenses); manifest.variants = manifest.variants.filter((variant) => { + const video = variant.video; + // See: https://github.com/google/shaka-player/issues/3380 + if (shaka.util.Platform.isXboxOne() && video && + ((video.width && video.width > 1920) || + (video.height && video.height > 1080)) && + video.codecs.includes('avc1.')) { + shaka.log.debug('Dropping variant - not compatible with platform', + shaka.util.StreamUtils.getVariantSummaryString_(variant)); + return false; + } + const supported = variant.decodingInfos.some((decodingInfo) => { return decodingInfo.supported; }); @@ -448,6 +459,16 @@ shaka.util.StreamUtils = class { return false; } + // See: https://github.com/google/shaka-player/issues/3380 + if (shaka.util.Platform.isXboxOne() && video && + ((video.width && video.width > 1920) || + (video.height && video.height > 1080)) && + video.codecs.includes('avc1.')) { + shaka.log.debug('Dropping variant - video not compatible with platform', + StreamUtils.getStreamSummaryString_(video)); + return false; + } + return true; }); }