Skip to content

Commit

Permalink
Remove aliases for BufferUtils in DrmEngine.
Browse files Browse the repository at this point in the history
That alias was confusing the closure compiler, and causing it to
produce invalid output when making release versions.

Closes #2438

Change-Id: Ic232ce4f29222543b13c2cc725ffefaedea29e3a
  • Loading branch information
theodab committed Mar 5, 2020
1 parent 95a2814 commit ea0131d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/media/drm_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,15 +507,12 @@ shaka.media.DrmEngine = class {
* @param {!Uint8Array} initData
*/
newInitData(initDataType, initData) {
// Aliases:
const BufferUtils = shaka.util.BufferUtils;

// Suppress duplicate init data.
// Note that some init data are extremely large and can't portably be used
// as keys in a dictionary.
const metadatas = this.activeSessions_.values();
for (const metadata of metadatas) {
if (BufferUtils.equal(initData, metadata.initData)) {
if (shaka.util.BufferUtils.equal(initData, metadata.initData)) {
shaka.log.debug('Ignoring duplicate init data.');
return;
}
Expand Down Expand Up @@ -1779,9 +1776,6 @@ shaka.media.DrmEngine = class {
};

for (const drmInfo of drmInfos) {
// Aliases:
const BufferUtils = shaka.util.BufferUtils;

// Build an array of unique license servers.
if (!licenseServers.includes(drmInfo.licenseServerUri)) {
licenseServers.push(drmInfo.licenseServerUri);
Expand All @@ -1790,7 +1784,8 @@ shaka.media.DrmEngine = class {
// Build an array of unique server certs.
if (drmInfo.serverCertificate) {
const found = serverCerts.some(
(cert) => BufferUtils.equal(cert, drmInfo.serverCertificate));
(cert) => shaka.util.BufferUtils.equal(
cert, drmInfo.serverCertificate));
if (!found) {
serverCerts.push(drmInfo.serverCertificate);
}
Expand Down

0 comments on commit ea0131d

Please sign in to comment.