Skip to content

Commit

Permalink
Use BitrateUtil
Browse files Browse the repository at this point in the history
  • Loading branch information
StaehliJ committed Jul 29, 2024
1 parent af14a9e commit f5a8911
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import ch.srgssr.pillarbox.player.analytics.PillarboxAnalyticsListener
import ch.srgssr.pillarbox.player.analytics.PlaybackSessionManager
import ch.srgssr.pillarbox.player.analytics.metrics.MetricsCollector
import ch.srgssr.pillarbox.player.analytics.metrics.PlaybackMetrics
import ch.srgssr.pillarbox.player.utils.BitrateUtil.toByteRate
import ch.srgssr.pillarbox.player.utils.DebugLogger
import ch.srgssr.pillarbox.player.utils.Heartbeat
import kotlin.coroutines.CoroutineContext
Expand Down Expand Up @@ -115,8 +116,8 @@ internal class QoSCoordinator(
}

private fun PlaybackMetrics.toQoSEvent(): QoSEvent {
val bitrateBytes = indicatedBitrate / Byte.SIZE_BYTES
val bandwidthBytes = bandwidth / Byte.SIZE_BYTES
val bitrateBytes = indicatedBitrate.toByteRate()
val bandwidthBytes = bandwidth.toByteRate()
return QoSEvent(
bandwidth = bandwidthBytes,
bitrate = bitrateBytes.toInt(),
Expand Down

0 comments on commit f5a8911

Please sign in to comment.