@@ -196,6 +196,7 @@ class BitrateController<T : MediaSourceContainer> @JvmOverloads constructor(
196196 var totalTargetBitrate = 0 .bps
197197 var totalIdealBitrate = 0 .bps
198198 val activeSsrcs = mutableSetOf<Long >()
199+ var hasNonIdealLayer = false
199200
200201 val nowMs = clock.instant().toEpochMilli()
201202 val allocation = bandwidthAllocator.allocation
@@ -216,14 +217,19 @@ class BitrateController<T : MediaSourceContainer> @JvmOverloads constructor(
216217 allocationIdealBitrate?.let {
217218 totalIdealBitrate + = it
218219 }
220+
221+ if (singleAllocation.idealLayer != null && singleAllocation.idealLayer != singleAllocation.targetLayer) {
222+ hasNonIdealLayer = true
223+ }
219224 }
220225
221226 activeSsrcs.removeIf { it < 0 }
222227
223228 return BitrateControllerStatusSnapshot (
224229 currentTargetBps = totalTargetBitrate.bps.toLong(),
225230 currentIdealBps = totalIdealBitrate.bps.toLong(),
226- activeSsrcs = activeSsrcs
231+ activeSsrcs = activeSsrcs,
232+ hasNonIdealLayer = hasNonIdealLayer
227233 )
228234 }
229235
@@ -322,5 +328,6 @@ interface MediaSourceContainer {
322328data class BitrateControllerStatusSnapshot (
323329 val currentTargetBps : Long = -1L ,
324330 val currentIdealBps : Long = -1L ,
325- val activeSsrcs : Collection <Long > = emptyList()
331+ val activeSsrcs : Collection <Long > = emptyList(),
332+ val hasNonIdealLayer : Boolean
326333)
0 commit comments