Fixing a couple of bugs in StreamAllocator (#225)

* Debug

* More debug

* break -> return

* comment

* Clean up

* spelling fixed
This commit is contained in:
Raja Subramanian
2021-12-02 14:43:56 +05:30
committed by GitHub
parent 6510692f23
commit 5eb58bcb41

View File

@@ -253,10 +253,9 @@ func (f *Forwarder) allocate(availableChannelCapacity int64, canPause bool, brs
if availableChannelCapacity == ChannelCapacityInfinity {
// channel capacity allows a free pass.
// So, resume with the highest layer available <= max subscribed layer
// if already optimistically started, nothing else to do
if f.targetSpatialLayer != InvalidSpatialLayer {
return
// If already resumed, move allocation to the highest available layer <= max subscribed layer
if f.targetSpatialLayer == InvalidSpatialLayer {
result.change = VideoStreamingChangeResuming
}
f.targetSpatialLayer = int32(f.availableLayers[len(f.availableLayers)-1])
@@ -269,7 +268,6 @@ func (f *Forwarder) allocate(availableChannelCapacity int64, canPause bool, brs
f.targetTemporalLayer = 0
}
result.change = VideoStreamingChangeResuming
} else {
// if not optimistically started, nothing else to do
if f.targetSpatialLayer == InvalidSpatialLayer {
@@ -390,7 +388,7 @@ func (f *Forwarder) FinalizeAllocate(brs [3][4]int64) {
f.targetSpatialLayer = int32(i)
f.targetTemporalLayer = int32(j)
break
return
}
}
}