Skip to content

Commit

Permalink
Call it Overall Bitrate if bitrate is not available
Browse files Browse the repository at this point in the history
Signed-off-by: Jyotiraditya Panda <[email protected]>
  • Loading branch information
imjyotiraditya committed Nov 22, 2024
1 parent 9a990ad commit 846121d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ class AudioFormatDetector {
if (!group.isTrackSelected(i)) continue

val format = group.getTrackFormat(i)
val bitrate = calculateBitrate(player)
val bitrate = if (format.bitrate != Format.NO_VALUE) {
format.bitrate
} else {
calculateOverallBitrate(player)
}

val rawSampleRate = format.sampleRate
val sampleRate = normalizeToStandardRate(rawSampleRate)
Expand Down Expand Up @@ -126,7 +130,7 @@ class AudioFormatDetector {
return null
}

private fun calculateBitrate(player: Player?): Int? {
private fun calculateOverallBitrate(player: Player?): Int? {
if (player == null) return null

val duration = player.duration
Expand Down

0 comments on commit 846121d

Please sign in to comment.