diff options
author | dhewg | 2011-03-14 20:26:35 +0100 |
---|---|---|
committer | dhewg | 2011-03-14 20:26:35 +0100 |
commit | 9e7ee4953ec5ca41a30c178ce778149a86f07b8f (patch) | |
tree | eed8430a4f4f26897c2f97533ea46e4222195566 | |
parent | f706b1568d286bb2c145046e4d3f04f6ee177314 (diff) | |
download | scummvm-rg350-9e7ee4953ec5ca41a30c178ce778149a86f07b8f.tar.gz scummvm-rg350-9e7ee4953ec5ca41a30c178ce778149a86f07b8f.tar.bz2 scummvm-rg350-9e7ee4953ec5ca41a30c178ce778149a86f07b8f.zip |
ANDROID: Halve the audio buffer size
Also, run into the blocking audio write without sleep. This hopefully
fixes audio hickups on slow devices.
-rw-r--r-- | backends/platform/android/android.cpp | 4 | ||||
-rw-r--r-- | backends/platform/android/org/inodes/gus/scummvm/ScummVM.java | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index 7731c53873..72810b6fb7 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -286,9 +286,7 @@ void *OSystem_Android::audioThreadFunc(void *arg) { if (written < 0) break; - // sleep a little, prepare the next buffer, and run into the - // blocking AudioTrack.write - nanosleep(&tv_delay, 0); + // prepare the next buffer, and run into the blocking AudioTrack.write } JNI::setAudioStop(); diff --git a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java index 0bc5f3ce4c..dfb585518a 100644 --- a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java +++ b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java @@ -245,8 +245,8 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable { AudioFormat.CHANNEL_CONFIGURATION_STEREO, AudioFormat.ENCODING_PCM_16BIT); - // ~100ms - int buffer_size_want = (_sample_rate * 2 * 2 / 10) & ~1023; + // ~50ms + int buffer_size_want = (_sample_rate * 2 * 2 / 20) & ~1023; if (_buffer_size < buffer_size_want) { Log.w(LOG_TAG, String.format( |