Commit e8fd3025 by Oliver Woodman

Fix propagation of sample encryption key for webm

parent ead25a9d
......@@ -168,6 +168,7 @@ public final class WebmExtractor implements Extractor {
private int sampleCurrentNalBytesRemaining;
private int sampleTrackNumber;
private int sampleFlags;
private byte[] sampleEncryptionKeyId;
private long sampleTimeUs;
private boolean sampleRead;
private boolean sampleSeenReferenceBlock;
......@@ -608,6 +609,7 @@ public final class WebmExtractor implements Extractor {
sampleFlags = (isKeyframe ? C.SAMPLE_FLAG_SYNC : 0)
| (isInvisible ? C.SAMPLE_FLAG_DECODE_ONLY : 0)
| (isEncrypted ? C.SAMPLE_FLAG_ENCRYPTED : 0);
sampleEncryptionKeyId = sampleTrackFormat.encryptionKeyId;
sampleSize = contentSize - blockBytesRead;
if (isEncrypted) {
// Write the vector size.
......@@ -682,7 +684,7 @@ public final class WebmExtractor implements Extractor {
}
private void outputSampleMetadata(TrackOutput trackOutput) {
trackOutput.sampleMetadata(sampleTimeUs, sampleFlags, sampleSize, 0, null);
trackOutput.sampleMetadata(sampleTimeUs, sampleFlags, sampleSize, 0, sampleEncryptionKeyId);
sampleState = SAMPLE_STATE_START;
sampleRead = true;
}
......
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