gabrielfari / aacdecoder-android

Automatically exported from code.google.com/p/aacdecoder-android
GNU Lesser General Public License v3.0
1 stars 0 forks source link

Extraneous BufferReader capacity on some streams #58

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Running the following stream or others like it though the multiplayer 
function: http://195.150.20.243:8000/rmf_gold

What is the expected output? What do you see instead?
Expected BufferReader return between 1,000 and 20,000, example: "BufferReader: 
init(): capacity=2800"

Returned "BufferReader: init(): capacity=11200000" instead

What version of the product are you using? On which device ?
aacdecoder-android-0.8
Android SDK version 18.0
Eclipse SDK version 3.7.2

What is the URL of the stream ?
http://195.150.20.243:8000/rmf_gold

Please provide any additional information below.
Streams returning enormous buffer capacities take upwards of 20 minutes to 
start playing instead of the normal 1 - 2 second start time.  A somewhat rare 
event, it seems like being able to hard cap the capacity value in the 
BufferReader class might stop this from happening?

Original issue reported on code.google.com by btil...@dar.fm on 4 Jun 2014 at 9:50

GoogleCodeExporter commented 8 years ago
The server declares the bit-rate in bits/second  (128000) instead of kbits/sec 
(128):

* Connected to 195.150.20.243 (195.150.20.243) port 8000
> GET /rmf_gold HTTP/1.1
> User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b 
zlib/1.2.3 libidn/0.6.5
> Host: 195.150.20.243:8000
> Accept: */*
> 
< HTTP/1.0 200 OK
< Content-Type: audio/mpeg
< icy-br:128000
< icy-genre:RMF GOLD
< icy-name:[RMF GOLD]
< icy-notice1:<BR>This stream requires <a 
href="http://www.winamp.com/">Winamp</a><BR>
< icy-notice2:SHOUTcast Distributed Network Audio Server/win32 v1.9.8<BR>
< icy-pub:0
< icy-url:http://miastomuzyki.pl/
< Server: Icecast 2.3.2-kh33
< Cache-Control: no-cache
< Expires: Mon, 26 Jul 1997 05:00:00 GMT
< Pragma: no-cache

Try to use the following method of the AACPlayer and pass the second parameter 
(128) - see the javadoc:

     /**
     * Plays a stream synchronously.
     * @param url the URL of the stream or file
     * @param expectedKBitSecRate the expected average bitrate in kbit/sec;
     *      -1 means unknown;
     *      when setting this parameter, then the declared bit-rate from the stream header is ignored
     */
    public void play( String url, int expectedKBitSecRate ) throws Exception 

V.

Original comment by vbarta...@gmail.com on 10 Jun 2014 at 7:15