How to get Android MediaPlayer to use only one connection to download music?

My problem is that the new ICS MediaPlayer Android player now downloads music in two steps:

1) It sends a request to the HTTP server, and the server starts sending the mp3 file:

GET /stream/test.mp3 HTTP/1.1
Host: 192.168.30.113
Connection: keep-alive
User-Agent: stagefright/1.2 (Linux;Android 4.0.3)
Accept-Encoding: gzip,deflate

HTTP/1.1 200 OK
Date: Thu, 19 Apr 2012 07:37:29 GMT
Server: Apache/2.2.21 (Win64) PHP/5.3.8
Last-Modified: Sat, 03 Feb 2007 11:17:50 GMT
ETag: "6d0000000400e4-5b415f-428909c5e7a6b"
Accept-Ranges: bytes
Content-Length: 5980511
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: audio/mpeg

2) He closes the first connection and again opens another:

GET /stream/test.mp3 HTTP/1.1
Host: 192.168.30.113
Accept: */*

HTTP/1.1 200 OK
Date: Thu, 19 Apr 2012 07:37:41 GMT
Server: Apache/2.2.21 (Win64) PHP/5.3.8
Last-Modified: Sat, 03 Feb 2007 11:17:50 GMT
ETag: "6d0000000400e4-5b415f-428909c5e7a6b"
Accept-Ranges: bytes
Content-Length: 5980511
Content-Type: audio/mpeg

So, how can I go back to the previous function in android 2.3.3 when only one connection was used to download mp3?

Thank.

Edit: I see that MediaPlayer is based on the network state, in fact, depending on the connection speed: wifi or 3G MediaPlayer uses these two connections, but with EDGE it uses only one.

I think this may explain why many users talk about long buffering times before starting music.

+3
1

, , .

GET/stream/test.mp3 HTTP/1.1 : 192.168.30.113 : User-Agent: stagefright/1.2 (Linux, Android 4.0.3) Accept-Encoding: gzip, deflate

.

,

0

All Articles