feat: show audio codec and bitrate in player quality info#5909
Open
eran132 wants to merge 1 commit into
Open
Conversation
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>
There was a problem hiding this comment.
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() : ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
After, it also appends the audio codec and (optionally) the audio bitrate:
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-3or just stereoopus. 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 existingTrackSelectorUtil.extractCodec()/extractBitrate()helpers — the same ones already used for video.mEnableBitrate) as the video bitrate, so users who keep bitrate display off see just the codec.getQualityLabel()'s existingcombine()call; empty values are skipped bycombine(), so nothing changes when audio info is unavailable.One file changed, +11/-1.
Testing
Built locally:
./gradlew :common:compileStstableDebugJavaWithJavac→ BUILD SUCCESSFUL (JDK 17, AGP 7.4.2, compileSdk 34).Closes #5897
🤖 Generated with Claude Code