问题
We are experiencing almost the exact opposite of what is mentioned here: Why does it take so long for Android's MediaPlayer to prepare some live streams for playback?
I've tested multiple streams but two in particular
1 - http://usa8-vn.mixstream.net:8138 - SampleRate: 32000Hz and Bitrate: 96 kb/s
2 - http://source01.platform02.true.nl:800 - SampleRate: 44100Hz and Bitrate: 128 kb/s
The lower bitrate stream starts playing instantly (as soon as the media player is prepared
), while the higher bitrate stream takes up to two minutes to start playing. Also, when attempting to stream the higher bitrate stream I get MediaPlayer error (1, -110)
(which is supposedly a MEDIA_ERROR_UNKNOWN
, and MEDIA_ERROR_TIMED_OUT
- obviously, because it takes too long to load something). Then, when I stop the stream, I see this in my LogCat:
05-22 20:26:13.625: E/MediaPlayer(23818): stop called in state 0
05-22 20:26:13.625: V/MediaPlayer(23818): message received msg=100, ext1=-38, ext2=0
05-22 20:26:13.625: E/MediaPlayer(23818): error (-38, 0)
...
05-22 20:26:13.645: W/MediaPlayer(23818): mediaplayer went away with unhandled events
I can't find a -38
code on the Android site, so I don't know what that is. I also am not sure which state is state 0
. I'm assuming Idle
because the Android site state:
There is a subtle but important difference between a newly constructed MediaPlayer object and the MediaPlayer object after reset() is called. It is a programming error to invoke methods such as ... stop() ... in the Idle state for both cases.
Anyway, the point is that I don't think it's like the before mentioned link suggests, because the higher bitrate is supposed to fill the buffer quicker than the lower bitrate stream, right? So why does it take so long to start the stream?
As a side note, this works perfectly fine on the following devices: Samsung Galaxy Music, - Note, - Note II, - S II, - S III mini and Google Nexus devices. It's JUST on the Samsung Galaxy S III that we're experiencign this lag in streaming live music from the internet.
Why??
来源:https://stackoverflow.com/questions/16693601/why-does-it-take-longer-for-some-internet-audio-streams-to-start-playing-on-a-sa