Skip to content

Commit

Permalink
Fix loadDrmInitData given DASH manifest parser changes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ojw28 committed Jan 4, 2018
1 parent c89cc81 commit a1bac99
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit a1bac99

Please sign in to comment.