Commit a1bac99f by olly Committed by Oliver Woodman

Fix loadDrmInitData given DASH manifest parser changes

DASH manifests can now contain non-null but incomplete
DRM init data. Hence using the manifest init data when
non-null is not always the correct thing to do. This
change merges the sample and manifest formats (which
correctly merges the DRM init data) and then uses the
result.

Issue: #3630

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180787784
parent c89cc81b
...@@ -81,14 +81,11 @@ public final class DashUtil { ...@@ -81,14 +81,11 @@ public final class DashUtil {
return null; return null;
} }
} }
DrmInitData drmInitData = representation.format.drmInitData; Format manifestFormat = representation.format;
if (drmInitData != null) {
// Prefer drmInitData obtained from the manifest over drmInitData obtained from the stream,
// as per DASH IF Interoperability Recommendations V3.0, 7.5.3.
return drmInitData;
}
Format sampleFormat = DashUtil.loadSampleFormat(dataSource, primaryTrackType, representation); Format sampleFormat = DashUtil.loadSampleFormat(dataSource, primaryTrackType, representation);
return sampleFormat == null ? null : sampleFormat.drmInitData; return sampleFormat == null
? manifestFormat.drmInitData
: sampleFormat.copyWithManifestFormatInfo(manifestFormat).drmInitData;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment