Skip to content

Commit

Permalink
Merge branch 'patch/v1.5.x'
Browse files Browse the repository at this point in the history
* patch/v1.5.x:
  Make sure `reduceMaxBufferLength` can reach a min length of fragment duration resulting in buffer full error (#6539)
  Fix parsing of multiple codecs when converting from AVC1 to AVCOTI
  Fix XSS vulnerability by validating user input stream URL.
  • Loading branch information
robwalch committed Jul 3, 2024
2 parents a3e0667 + cedf96d commit e1ce07a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/controller/base-stream-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1161,12 +1161,13 @@ export default class BaseStreamController
protected reduceMaxBufferLength(threshold: number, fragDuration: number) {
const config = this.config;
const minLength = Math.max(
Math.min(threshold, config.maxBufferLength),
Math.min(threshold - fragDuration, config.maxBufferLength),
fragDuration,
);
const reducedLength = Math.max(
threshold - fragDuration * 3,
config.maxMaxBufferLength / 2,
minLength,
);
if (reducedLength >= minLength) {
// reduce max buffer length as it might be too high. we do this to avoid loop flushing ...
Expand Down

0 comments on commit e1ce07a

Please sign in to comment.