mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +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 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 {
|
||||||
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 {
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue