Skip to content

Commit

Permalink
fix:Filter unsupported H.264 streams in Xbox (shaka-project#3411)
Browse files Browse the repository at this point in the history
  • Loading branch information
Álvaro Velad Galván committed May 17, 2021
1 parent 9ffc111 commit a096bc1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/util/stream_utils.js
Expand Up @@ -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;
});
Expand Down Expand Up @@ -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;
});
}
Expand Down

0 comments on commit a096bc1

Please sign in to comment.