mirror of
https://github.com/samsonjs/media.git
synced 2026-04-04 11:05:47 +00:00
Fix propagation of sample encryption key for webm
This commit is contained in:
parent
ead25a9dfe
commit
e8fd3025e3
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue