Fixing a couple of bugs in StreamAllocator (#225)
* Debug * More debug * break -> return * comment * Clean up * spelling fixed
This commit is contained in:
@@ -253,10 +253,9 @@ func (f *Forwarder) allocate(availableChannelCapacity int64, canPause bool, brs
|
|||||||
if availableChannelCapacity == ChannelCapacityInfinity {
|
if availableChannelCapacity == ChannelCapacityInfinity {
|
||||||
// channel capacity allows a free pass.
|
// channel capacity allows a free pass.
|
||||||
// So, resume with the highest layer available <= max subscribed layer
|
// So, resume with the highest layer available <= max subscribed layer
|
||||||
|
// If already resumed, move allocation to the highest available layer <= max subscribed layer
|
||||||
// if already optimistically started, nothing else to do
|
if f.targetSpatialLayer == InvalidSpatialLayer {
|
||||||
if f.targetSpatialLayer != InvalidSpatialLayer {
|
result.change = VideoStreamingChangeResuming
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
f.targetSpatialLayer = int32(f.availableLayers[len(f.availableLayers)-1])
|
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
|
f.targetTemporalLayer = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
result.change = VideoStreamingChangeResuming
|
|
||||||
} else {
|
} else {
|
||||||
// if not optimistically started, nothing else to do
|
// if not optimistically started, nothing else to do
|
||||||
if f.targetSpatialLayer == InvalidSpatialLayer {
|
if f.targetSpatialLayer == InvalidSpatialLayer {
|
||||||
@@ -390,7 +388,7 @@ func (f *Forwarder) FinalizeAllocate(brs [3][4]int64) {
|
|||||||
|
|
||||||
f.targetSpatialLayer = int32(i)
|
f.targetSpatialLayer = int32(i)
|
||||||
f.targetTemporalLayer = int32(j)
|
f.targetTemporalLayer = int32(j)
|
||||||
break
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user