I want to play an audio stream from a URL that is valid only for a period of time. This doesn’t work very well using the built-in real-time streaming functionality due to the buffering mechanism (the URL will be dead by the time the buffer is full a second time), so I implemented a proxy stream similar to what was done in the npr application
http://code.google.com/p/npr-android-app/source/browse/trunk/Npr/src/org/npr/android/news/StreamProxy.java
This really works very well, with one exception, any call to the call effectively destroys the proxy flow. I find it difficult to determine exactly how searches work in the stage. Every time I search, I get a message
01-12 13:35:57.201: ERROR/(4870): Connection reset by peer
01-12 13:35:57.201: ERROR/(4870): java.net.SocketException: Connection reset by peer
01-12 13:35:57.201: ERROR/(4870): at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketImpl(Native Method)
01-12 13:35:57.201: ERROR/(4870): at org.apache.harmony.luni.platform.OSNetworkSystem.write(OSNetworkSystem.java:723)
01-12 13:35:57.201: ERROR/(4870): at org.apache.harmony.luni.net.PlainSocketImpl.write(PlainSocketImpl.java:578)
01-12 13:35:57.201: ERROR/(4870): at org.apache.harmony.luni.net.SocketOutputStream.write(SocketOutputStream.java:59)
01-12 13:35:57.201: ERROR/(4870): at com.soundcloud.utils.StreamProxy.processRequest(StreamProxy.java:209)
, stagefright URL- ( , - reset). , , - :
while (isRunning && (readBytes = data.read(buff, 0, buff.length)) != -1)
, , - . ( )?
. - ?