From a5fb9e43b51b9ed0dac97123ed5be7ab6f59049e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaquim=20Sta=CC=88hli?= Date: Thu, 25 Jul 2024 11:36:42 +0200 Subject: [PATCH] Return NO_VALUE if both Format are not defined --- .../srgssr/pillarbox/player/analytics/metrics/SessionMetrics.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pillarbox-player/src/main/java/ch/srgssr/pillarbox/player/analytics/metrics/SessionMetrics.kt b/pillarbox-player/src/main/java/ch/srgssr/pillarbox/player/analytics/metrics/SessionMetrics.kt index ae6c4a2c3..5781451f5 100644 --- a/pillarbox-player/src/main/java/ch/srgssr/pillarbox/player/analytics/metrics/SessionMetrics.kt +++ b/pillarbox-player/src/main/java/ch/srgssr/pillarbox/player/analytics/metrics/SessionMetrics.kt @@ -94,7 +94,7 @@ internal class SessionMetrics internal constructor( fun getTotalBitrate(): Long { val videoBitrate = videoFormat?.bitrate ?: Format.NO_VALUE val audioBitrate = audioFormat?.bitrate ?: Format.NO_VALUE - var bitrate = 0L + var bitrate = Format.NO_VALUE.toLong() if (videoBitrate > 0) bitrate += videoBitrate if (audioBitrate > 0) bitrate += audioBitrate return bitrate