Skip to content

Commit

Permalink
Fix: changeType() is Not Fully Implemented on Sony PS5 (#4149)
Browse files Browse the repository at this point in the history
  • Loading branch information
agajassi committed Mar 29, 2023
1 parent e070372 commit 389c145
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/streaming/SourceBufferSink.js
Expand Up @@ -83,7 +83,10 @@ function SourceBufferSink(config) {

promises.push(_abortBeforeAppend());
promises.push(updateAppendWindow(mediaInfo.streamInfo));
promises.push(changeType(codec));

if (settings.get().streaming.buffer.useChangeTypeForTrackSwitch) {
promises.push(changeType(codec));
}

if (selectedRepresentation && selectedRepresentation.MSETimeOffset !== undefined) {
promises.push(updateTimestampOffset(selectedRepresentation.MSETimeOffset));
Expand Down
2 changes: 1 addition & 1 deletion src/streaming/controllers/StreamController.js
Expand Up @@ -622,7 +622,7 @@ function StreamController() {
// Seamless period switch allowed only if:
// - none of the periods uses contentProtection.
// - AND changeType method implemented by browser or periods use the same codec.
return (settings.get().streaming.buffer.reuseExistingSourceBuffers && (previousStream.isProtectionCompatible(nextStream) || firstLicenseIsFetched) && (supportsChangeType || previousStream.isMediaCodecCompatible(nextStream, previousStream)));
return (settings.get().streaming.buffer.reuseExistingSourceBuffers && (previousStream.isProtectionCompatible(nextStream) || firstLicenseIsFetched) && (supportsChangeType && settings.get().streaming.buffer.useChangeTypeForTrackSwitch || previousStream.isMediaCodecCompatible(nextStream, previousStream)));
} catch (e) {
return false;
}
Expand Down

0 comments on commit 389c145

Please sign in to comment.