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
This commit is contained in:
olly 2018-01-04 05:39:42 -08:00 committed by Oliver Woodman
parent c89cc81b71
commit a1bac99f3b

View file

@ -81,14 +81,11 @@ public final class DashUtil {
return null;
}
}
DrmInitData drmInitData = representation.format.drmInitData;
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 manifestFormat = representation.format;
Format sampleFormat = DashUtil.loadSampleFormat(dataSource, primaryTrackType, representation);
return sampleFormat == null ? null : sampleFormat.drmInitData;
return sampleFormat == null
? manifestFormat.drmInitData
: sampleFormat.copyWithManifestFormatInfo(manifestFormat).drmInitData;
}
/**