0

Turns out the Android Media Player (stagefright) has some weird buffering algorithm for variable bitrate files. It seems to try to buffer multiple megabytes (2-3 MB on a 5MB total MP3 file) until it starts playing. To make things worse, it may start the playback after buffering a large enough amount (e.g. 2MB), then stop playback again, wait until it buffers another MB before it resumes.

This happens only to VBR MP3 files to my experience and only on stagefright. So, is there a way to work around this?

Daniel
  • 2,087
  • 3
  • 23
  • 37

1 Answers1

0

I found a "hack" to work around it:

I am removing the "Xing" header from the MP3 file when serving it from the HTTP server. This way stagefright already starts rendering after buffering about 0.5MB and no stutter was experienced so far.

Note, removing the Xing header may have side effects like messed up time and seek behavior. But as long as you don't use seek or display the time (as extracted from the MP3 stream) then you should be fine.

Daniel
  • 2,087
  • 3
  • 23
  • 37