Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VorbisComment keys should be compared case-insensitively #876

artur-shaik opened this issue Dec 8, 2023 · 2 comments

VorbisComment keys should be compared case-insensitively #876

artur-shaik opened this issue Dec 8, 2023 · 2 comments


Copy link

artur-shaik commented Dec 8, 2023

Use case description

There is no icy-title tag in ogg formated stream, this leads to the fact that all android apps that use this lib cannot display current playing metadata.

here is ffprobe results:

ffprobe -show_streams -show_format
Input #0, ogg, from '':
    icy-index-metadata: 1
    icy-logo        :
    icy-country-code: kg
    icy-language-codes: en,ru
    icy-genre       : trance,house
    icy-description : Description
    icy-name        : ColdStar.Online Radio (High quality)
    icy-pub         : 1
  Duration: N/A, start: 5552.966667, bitrate: 256 kb/s
  Stream #0:0: Audio: vorbis, 48000 Hz, stereo, fltp, 256 kb/s
      title           : Solarstone - Pure Trance Radio 384 (2023-11-29)
      server          : Icecast 2.4.4

Proposed solution

Consider parsing title tag in ogg stream.

Alternatives considered

Tryied to apply icy-title to ogg stream manually, but it turned out that it just doesn't support it.

Copy link

icbaker commented Dec 11, 2023

When I play in the demo app, I see the following in logcat:

Metadata [
  VC: title=GroupTherapy 558: Sultan + Shepard ft. Nathan Nicholson - Under The Surface 
  VC: server=Icecast 2.4.4
  IcyHeaders: name="Coldstar Online", genre="trance,house", bitrate=-1, metadataInterval=-1

VC = VorbisComment

So it looks like the title is being parsed.

It doesn't seem to be propagated to MediaMetadata.title (I listened to Player.Listener.onMediaMetadataChanged in the demo app, and it was always title=null).

I checked the implementation of VorbisComment.populateMediaMetadata and it is checking for a tag with key="TITLE" (case sensitive) - whereas this stream has key="title". Modifying the implementation to be case insensitive emits the following from onMediaMetadataChanged:

mediaMetadata.title=GroupTherapy 558: A.M.R - Here We Are

Checking for "TITLE" probably comes from this spec: - but it looks like we missed this bit (emphasis mine): "A case-insensitive field name".

I'll update the implementation of VorbisComment.populateMediaMetadata to be case-insensitive when comparing key names.

If this doesn't resolve your issue, or I've misunderstood the problem, please do clarify :)

@icbaker icbaker changed the title OGG container current track metadata VorbisComment keys should be compared case-insensitively Dec 11, 2023
Copy link

artur-shaik commented Dec 12, 2023

That sounds like a solution for this issue.

copybara-service bot pushed a commit that referenced this issue Dec 12, 2023
Issue: #876


PiperOrigin-RevId: 590215918
copybara-service bot pushed a commit to google/ExoPlayer that referenced this issue Dec 12, 2023
@icbaker icbaker closed this as completed Dec 13, 2023
microkatz pushed a commit that referenced this issue Jan 11, 2024
Issue: #876


PiperOrigin-RevId: 590215918
(cherry picked from commit 5580b78)
@androidx androidx locked and limited conversation to collaborators Feb 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

2 participants