diff --git a/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DashUtil.java b/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DashUtil.java index ed2f916b879..57632225a50 100644 --- a/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DashUtil.java +++ b/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DashUtil.java @@ -81,14 +81,11 @@ public static DrmInitData loadDrmInitData(DataSource dataSource, Period period) 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; } /**