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