[Android] fix IllegalStateException in Aout.playBuffer

Sébastien Toque git at videolan.org
Mon Jul 2 21:10:33 CEST 2012


android | branch: master | Sébastien Toque <xilasz at gmail.com> | Mon Jul  2 21:09:43 2012 +0200| [ed478585a8426e861ffb149b63137e4358f5d438] | committer: Sébastien Toque

fix IllegalStateException in Aout.playBuffer

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=ed478585a8426e861ffb149b63137e4358f5d438
---

 vlc-android/src/org/videolan/vlc/Aout.java |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/Aout.java b/vlc-android/src/org/videolan/vlc/Aout.java
index 2e040c6..976861e 100644
--- a/vlc-android/src/org/videolan/vlc/Aout.java
+++ b/vlc-android/src/org/videolan/vlc/Aout.java
@@ -60,6 +60,8 @@ public class Aout {
     }
 
     public void playBuffer(byte[] audioData, int bufferSize) {
+        if (mAudioTrack.getState() == AudioTrack.STATE_UNINITIALIZED)
+            return;
         if (mAudioTrack.write(audioData, 0, bufferSize) != bufferSize) {
             Log.w(TAG, "Could not write all the samples to the audio device");
         }



More information about the Android mailing list