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

Seeking not available on some MP3 files (INFO used for CBR , XING for all others) #2895

Closed
samysousa opened this issue Jun 1, 2017 · 2 comments
Assignees
Labels

Comments

@samysousa
Copy link

Issue description

MP3 Files opened for ondemand playback are usually seekable except in certain cases where the INFO header is present but does not contain also a TOC (Table of contents).

MP3 File With NO INFO header --> Exoplayer Assumes CBR FILE and enables SEEKABLE (expected)
MP3 FILE WITH INFO HEADER + TOC --> Exoplayer enables SEEKABLE (expected)
MP3 FILE WITH INFO Header , But Without TOC --> Exoplayer disables SEEKABLE (Unexpected)

"XING" Headers do require that TOC be present.
"INFO" header do Not; since it declares file a CBR

Essentially, by observation, Exoplayer parses both INFO and XING headers exactly the same; but they are NOT, because "INFO" essentially declares file as CBR and extra TOC and other info is no longer required.

Unfortunately many encoders like LAME, FFMPEG will always produce INFO header without TOC (unneeded for CBR)

REF1 : http://www.multiweb.cz/twoinches/mp3inside.htm
REF 2 (FFMPEG LibavFormat Lines 397 to 409) : https://github.com/FFmpeg/FFmpeg/blob/ee5f0f1d355fa0fd9194ac97a2c8598c93ed328b/libavformat/mp3enc.c#L397

More information on XING here : https://www.codeproject.com/Articles/8295/MPEG-Audio-Frame-Header (Section 2.3.1)

Reproduction steps

Example File :
Contains INFO header (Not XING)
Does NOT Contain TOC (Not needed with INFO header)

https://omnystudio.com/d/clips/4b5f9d6d-9214-48cb-8455-a73200038129/3cbd8058-2b03-42e8-bd31-a7460050b45a/2c58ee44-8693-47e9-aef2-a746005c28c0/audio.mp3?utm_source=Podcast&in_playlist=53a88408-39f1-47b3-8948-a7460050b45e

Expected to SEEK as it is a CBR file

Current Behaviour tested in version 2.0.4 of Exoplayer until 2.4.1 version of Exoplayer : Does not enable Seek.

Link to test content

https://omnystudio.com/d/clips/4b5f9d6d-9214-48cb-8455-a73200038129/3cbd8058-2b03-42e8-bd31-a7460050b45a/2c58ee44-8693-47e9-aef2-a746005c28c0/audio.mp3?utm_source=Podcast&in_playlist=53a88408-39f1-47b3-8948-a7460050b45e

Version of ExoPlayer being used

Tested in 2.04 and 2.4.1
Behavior observed in both.

Device(s) and version(s) of Android being used

Unrelated.
But as context, Native players on many Android devices handle this correctly and this "bad behaviour" is not observed. Tested on Google Pixel

A full bug report captured from the device

Not capturable behaviour problem

@andrewlewis andrewlewis self-assigned this Jun 2, 2017
@andrewlewis andrewlewis added the bug label Jun 2, 2017
@andrewlewis
Copy link
Collaborator

Until this is fixed, I think you can call defaultExtractorsFactory.setMp3ExtractorFlags(Mp3Extractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING) to work around the issue.

@ojw28
Copy link
Contributor

ojw28 commented Jun 2, 2017

Thanks for the excellent issue report by the way; very helpful!

ojw28 pushed a commit that referenced this issue Jun 6, 2017
Issue: #2895

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157841519
@ojw28 ojw28 closed this as completed Jun 6, 2017
ojw28 pushed a commit that referenced this issue Jun 6, 2017
Issue: #2895

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157841519
@google google locked and limited conversation to collaborators Oct 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants