Skip to content

feat: show audio codec and bitrate in player quality info#5909

Open
eran132 wants to merge 1 commit into
yuliskov:masterfrom
eran132:feat/audio-codec-bitrate-quality-info
Open

feat: show audio codec and bitrate in player quality info#5909
eran132 wants to merge 1 commit into
yuliskov:masterfrom
eran132:feat/audio-codec-bitrate-quality-info

Conversation

@eran132

@eran132 eran132 commented Jun 16, 2026

Copy link
Copy Markdown

What

Adds the audio codec and audio bitrate to the on-screen playback quality info label.

Before, the label showed only video details — resolution, fps, video codec, video bitrate:

4K/24/AV1/15Mb

After, it also appends the audio codec and (optionally) the audio bitrate:

4K/24/AV1/15Mb/5.1/opus/0.15Mb

Why

Requested in #5897. There was no way to see the audio codec at a glance — you had to open the Audio formats menu to check whether, say, a music video carried eac3/ec-3 or just stereo opus. Surfacing it in the existing quality overlay removes that round-trip.

How

  • TrackInfoFormatter2.setAudioFormat() now extracts the audio codec (lower-cased, e.g. opus, ec-3) and audio bitrate via the existing TrackSelectorUtil.extractCodec() / extractBitrate() helpers — the same ones already used for video.
  • The audio bitrate respects the same "show bitrate" toggle (mEnableBitrate) as the video bitrate, so users who keep bitrate display off see just the codec.
  • Both values are appended in getQualityLabel()'s existing combine() call; empty values are skipped by combine(), so nothing changes when audio info is unavailable.

One file changed, +11/-1.

Testing

Built locally: ./gradlew :common:compileStstableDebugJavaWithJavacBUILD SUCCESSFUL (JDK 17, AGP 7.4.2, compileSdk 34).

Closes #5897

🤖 Generated with Claude Code

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 yuliskov#5897

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 16, 2026 09:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR extends the track quality label formatting to include audio codec and (optionally) audio bitrate details.

Changes:

  • Add new stored fields for audio codec and audio bitrate.
  • Populate those fields in setAudioFormat.
  • Include the new fields in getQualityLabel() output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +60 to +63
if (mEnableBitrate) {
String audioBitrate = TrackSelectorUtil.extractBitrate(format, 2);
mAudioBitrateStr = audioBitrate.isEmpty() ? "" : audioBitrate + "Mb";
}
Comment on lines +57 to +58
String audioCodec = TrackSelectorUtil.extractCodec(format);
mAudioCodecStr = audioCodec != null ? audioCodec.toLowerCase() : "";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: include audio codec & bitrate in player quality info

2 participants