Fix now-playing UI showing wrong song (issue #24)#25
Merged
Conversation
Disable ID3 metadata parsing on the transcoded MP3 streams. The app fully owns now-playing metadata via MediaItem.mediaMetadata, so ExoPlayer's in-band ID3 pass only adds a redundant, late onMediaMetadataChanged event per transition. That extra publish races the AAOS Media Center's two now-playing surfaces (full player title vs browse highlight), intermittently leaving them showing different tracks. Also add a debug log in onMediaMetadataChanged to confirm each transition produces a single clean metadata publish matching the current item id. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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.
Fixes #24
Problem
The AAOS full player screen and the browse "now playing" indicator occasionally disagree about the current track — sometimes the player shows the previous song while the browse view shows the real one, and sometimes the reverse. It's intermittent and happens in both directions.
Root cause
This is a sync/timing bug, not a wrong-value bug:
MediaItemFactory/MediaRepository.toMediaItem()path, so a given track always has identical title/art.Player.getMediaMetadata()populatesMediaItem.mediaMetadataon top of media-derived metadata, so our title always wins. In-band ID3 can never substitute a different song's title.Mp3Extractorparses the embedded ID3 tags and fires an extraonMediaMetadataChangedshortly after each transition, re-publishingMediaMetadataCompatto the legacyMediaSessionCompatbridge. When a late ID3 event for track B interleaves with the transition to track C, the two AAOS now-playing surfaces refresh on different events and end up disagreeing.Fix
Disable ID3 metadata extraction on the MP3 streams. The app fully owns now-playing metadata via
MediaItem.mediaMetadata, so the in-band ID3 pass is pure churn — removing it collapses each transition to a single, clean metadata publish.Also adds an
onMediaMetadataChangeddebug log to confirm, in a reproduction, that each transition now yields exactly one metadata change matching the current item id.No new Gradle dependency (extractor ships transitively with
media3-exoplayer1.9.2).Verification
./gradlew :automotive:assembleDebugbuilds cleanly.logcatshould show exactly oneonMediaMetadataChangedper transition withcurrentIdmatching the title.🤖 Generated with Claude Code