Skip to content

Commit

Permalink
Disable multiplying bitrate by channel count
Browse files Browse the repository at this point in the history
Signed-off-by: Patryk Miś <[email protected]>
  • Loading branch information
PatrykMis committed Jul 28, 2023
1 parent 1402f16 commit 16653b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app/src/main/kotlin/com/patrykmis/bar/format/AacFormat.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ object AacFormat : Format() {
} else {
MediaCodecInfo.CodecProfileLevel.AACObjectHE
}
val channelCount = getInteger(MediaFormat.KEY_CHANNEL_COUNT)

setInteger(MediaFormat.KEY_AAC_PROFILE, profile)
setInteger(MediaFormat.KEY_BIT_RATE, param.toInt() * channelCount)
setInteger(MediaFormat.KEY_BIT_RATE, param.toInt())
}
}

Expand Down
3 changes: 1 addition & 2 deletions app/src/main/kotlin/com/patrykmis/bar/format/OpusFormat.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ object OpusFormat : Format() {

override fun updateMediaFormat(mediaFormat: MediaFormat, param: UInt) {
mediaFormat.apply {
val channelCount = getInteger(MediaFormat.KEY_CHANNEL_COUNT)
setInteger(MediaFormat.KEY_BIT_RATE, param.toInt() * channelCount)
setInteger(MediaFormat.KEY_BIT_RATE, param.toInt())
}
}

Expand Down

0 comments on commit 16653b9

Please sign in to comment.