Commit dd06a2d5 by andrewlewis Committed by Oliver Woodman

Fix integer bitrate division

PiperOrigin-RevId: 237028164
parent 155a129d
...@@ -352,7 +352,8 @@ public final class BufferSizeAdaptationBuilder { ...@@ -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);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment