Skip to content

Commit

Permalink
fix: requestId init tag (#1518)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrums86 authored Jun 12, 2024
1 parent 5f2af5f commit a542ec8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/media-segment-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -852,10 +852,6 @@ const waitForCompletion = ({
segment.endOfAllRequests = Date.now();
if (segment.map && segment.map.encryptedBytes && !segment.map.bytes) {
triggerSegmentEventFn({ type: 'segmentdecryptionstart', segment });
// add -init to the "id" to differentiate between segment
// and init segment decryption, just in case they happen
// at the same time at some point in the future.
segment.requestId += '-init';
return decrypt({ decryptionWorker,
// add -init to the "id" to differentiate between segment
// and init segment decryption, just in case they happen
Expand Down
4 changes: 3 additions & 1 deletion test/media-segment-request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,8 @@ QUnit.test('init segment with key has bytes decrypted', function(assert) {
bytes: new Uint32Array([0, 0, 0, 1])
}
}
}
},
requestId: 'foo.bar.id'
},
trackInfoFn(segment, _trackInfo) {
trackInfo = _trackInfo;
Expand All @@ -779,6 +780,7 @@ QUnit.test('init segment with key has bytes decrypted', function(assert) {
16,
'key bytes are readable'
);
assert.equal(segmentData.requestId, 'foo.bar.id', 'requestId is expected value');

// verify stats
assert.equal(segmentData.stats.bytesReceived, 6198, '6198 bytes');
Expand Down

0 comments on commit a542ec8

Please sign in to comment.