From a95edacebaad975f6dc69781d9ef7a47be21a8a5 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 31 May 2016 22:32:10 +0900 Subject: [PATCH] audio: Remove unneeded padding --- audio/internal/driver/driver_android.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/audio/internal/driver/driver_android.go b/audio/internal/driver/driver_android.go index 90d7aae69..7cce818b1 100644 --- a/audio/internal/driver/driver_android.go +++ b/audio/internal/driver/driver_android.go @@ -102,20 +102,6 @@ static char* initAudioTrack(uintptr_t java_vm, uintptr_t jni_env, // Note that *audioTrack will never be released. *audioTrack = (*env)->NewGlobalRef(env, tmpAudioTrack); - // Enqueue empty bytes before playing to avoid underrunning. - // TODO: Is this really needed? At least, SDL doesn't do the same thing. - jint writtenBytes = 0; - do { - const int length = 1024; - jbyteArray arr = (*env)->NewByteArray(env, length); - writtenBytes = - (*env)->CallIntMethod( - env, *audioTrack, - (*env)->GetMethodID(env, android_media_AudioTrack, "write", "([BII)I"), - arr, 0, length); - } while (writtenBytes != 0); - // TODO: Check if writtenBytes < 0 - (*env)->CallVoidMethod( env, *audioTrack, (*env)->GetMethodID(env, android_media_AudioTrack, "play", "()V"));