Need to return delta the new provisional layer takes. (#433)

This commit is contained in:
Raja Subramanian
2022-02-11 14:04:47 +05:30
committed by GitHub
parent f3a6f58006
commit c9cfb0d362
2 changed files with 9 additions and 3 deletions
+2 -2
View File
@@ -550,13 +550,13 @@ func (f *Forwarder) ProvisionalAllocate(availableChannelCapacity int64, layers V
if requiredBitrate <= (availableChannelCapacity + alreadyAllocatedBitrate) {
f.provisional.layers = layers
return requiredBitrate
return requiredBitrate - alreadyAllocatedBitrate
}
// when pause is disallowed, pick the layer if none allocated already or something lower is available
if !allowPause && (f.provisional.layers == InvalidLayers || !layers.GreaterThan(f.provisional.layers)) {
f.provisional.layers = layers
return requiredBitrate
return requiredBitrate - alreadyAllocatedBitrate
}
return 0