From f2862b585fb4fae4fa1b77c7a12138ab6c5ea254 Mon Sep 17 00:00:00 2001 From: Eran Markus Date: Tue, 16 Jun 2026 12:02:02 +0300 Subject: [PATCH] feat: show audio codec and bitrate in player quality info The on-screen playback quality info displayed resolution, fps, video codec and video bitrate (e.g. "4K/24/AV1/15Mb") but no audio details, so users had to open the Audio formats menu to check the audio codec (e.g. whether a music video uses eac3 vs stereo opus). Append the audio codec and audio bitrate to the quality label, reusing the existing TrackSelectorUtil.extractCodec/extractBitrate helpers. The audio bitrate honours the same "show bitrate" toggle as the video one. Result: "4K/24/AV1/15Mb/5.1/opus/0.15Mb" Closes #5897 Co-Authored-By: Claude Opus 4.8 --- .../exoplayer/selector/TrackInfoFormatter2.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/exoplayer/selector/TrackInfoFormatter2.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/exoplayer/selector/TrackInfoFormatter2.java index a39ce7ce50..9584f2809a 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/exoplayer/selector/TrackInfoFormatter2.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/exoplayer/selector/TrackInfoFormatter2.java @@ -10,6 +10,8 @@ public class TrackInfoFormatter2 { private String mHdrStr; private String mSpeedStr; private String mChannelsStr; + private String mAudioCodecStr; + private String mAudioBitrateStr; private String mHighBitrateStr; private boolean mEnableBitrate; private String mDrcStr; @@ -52,6 +54,14 @@ public void setAudioFormat(Format format) { mChannelsStr = TrackSelectorUtil.buildChannels(format); + String audioCodec = TrackSelectorUtil.extractCodec(format); + mAudioCodecStr = audioCodec != null ? audioCodec.toLowerCase() : ""; + + if (mEnableBitrate) { + String audioBitrate = TrackSelectorUtil.extractBitrate(format, 2); + mAudioBitrateStr = audioBitrate.isEmpty() ? "" : audioBitrate + "Mb"; + } + mDrcStr = TrackSelectorUtil.buildDrcMark(format); } @@ -60,7 +70,7 @@ public void setSpeed(float speed) { } public String getQualityLabel() { - return combine(mResolutionStr, mFpsStr, mCodecStr, mBitrateStr, mHdrStr, mChannelsStr, mSpeedStr, mHighBitrateStr, mDrcStr); + return combine(mResolutionStr, mFpsStr, mCodecStr, mBitrateStr, mHdrStr, mChannelsStr, mAudioCodecStr, mAudioBitrateStr, mSpeedStr, mHighBitrateStr, mDrcStr); } private static String combine(String... items) {