mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix integer bitrate division
PiperOrigin-RevId: 237028164
This commit is contained in:
parent
155a129d2c
commit
dd06a2d5f1
1 changed files with 2 additions and 1 deletions
|
|
@ -352,7 +352,8 @@ public final class BufferSizeAdaptationBuilder {
|
||||||
// buffer = slope * ln(bitrate) + intercept,
|
// buffer = slope * ln(bitrate) + intercept,
|
||||||
// with buffer(minBitrate) = minBuffer and buffer(maxBitrate) = maxBuffer - hysteresisBuffer.
|
// with buffer(minBitrate) = minBuffer and buffer(maxBitrate) = maxBuffer - hysteresisBuffer.
|
||||||
bitrateToBufferFunctionSlope =
|
bitrateToBufferFunctionSlope =
|
||||||
(maxBufferUs - hysteresisBufferUs - minBufferUs) / Math.log(maxBitrate / minBitrate);
|
(maxBufferUs - hysteresisBufferUs - minBufferUs)
|
||||||
|
/ Math.log((double) maxBitrate / minBitrate);
|
||||||
bitrateToBufferFunctionIntercept =
|
bitrateToBufferFunctionIntercept =
|
||||||
minBufferUs - bitrateToBufferFunctionSlope * Math.log(minBitrate);
|
minBufferUs - bitrateToBufferFunctionSlope * Math.log(minBitrate);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue