From 16653b987cb71eeae349be679e70c423a6c2cd4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Mi=C5=9B?= Date: Fri, 28 Jul 2023 15:48:06 +0200 Subject: [PATCH] Disable multiplying bitrate by channel count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patryk Miś --- app/src/main/kotlin/com/patrykmis/bar/format/AacFormat.kt | 3 +-- app/src/main/kotlin/com/patrykmis/bar/format/OpusFormat.kt | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/patrykmis/bar/format/AacFormat.kt b/app/src/main/kotlin/com/patrykmis/bar/format/AacFormat.kt index 9014da383..532d6499e 100644 --- a/app/src/main/kotlin/com/patrykmis/bar/format/AacFormat.kt +++ b/app/src/main/kotlin/com/patrykmis/bar/format/AacFormat.kt @@ -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()) } } diff --git a/app/src/main/kotlin/com/patrykmis/bar/format/OpusFormat.kt b/app/src/main/kotlin/com/patrykmis/bar/format/OpusFormat.kt index e9b8a92b3..7fea26a75 100644 --- a/app/src/main/kotlin/com/patrykmis/bar/format/OpusFormat.kt +++ b/app/src/main/kotlin/com/patrykmis/bar/format/OpusFormat.kt @@ -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()) } }