Skip to content

Commit

Permalink
Treat codecs beginning with hev1 as hevc
Browse files Browse the repository at this point in the history
While working on new DRM integration test in #1478, to add tests for the
not-yet-released features proposed by #1484, I noticed that some
contents anounced HEVC by beginning the codec string with `hev` and
others with `hvc`.

When comparing family of codecs, we thus had false negative which may
mean we would have ended up playing encrypted hevc on devices where it
wasn't supported, if it was anounced in the MPD as `hev1...`.

I now treat both the same way.
  • Loading branch information
peaBerberian committed Aug 13, 2024
1 parent b7e6d44 commit 8a4c7c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/are_codecs_compatible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ function areCodecsCompatible(a: string, b: string): boolean {
if (codecsA === "" || codecsB === "") {
return false;
}
if (codecsA.split(".")[0] !== codecsB.split(".")[0]) {
let initialPartA = codecsA.split(".")[0];
initialPartA = initialPartA === "hev1" ? "hvc1" : initialPartA;
let initialPartB = codecsB.split(".")[0];
initialPartB = initialPartB === "hev1" ? "hvc1" : initialPartB;
if (initialPartA !== initialPartB) {
return false;
}
return true;
Expand Down

0 comments on commit 8a4c7c2

Please sign in to comment.