From b48c05fd9b6a3f8fc5333499251e4d526e5c4faa Mon Sep 17 00:00:00 2001 From: Luo Jinghua Date: Wed, 7 Dec 2011 13:46:47 +0800 Subject: Switch android device to push mode --- src/device_android.cpp | 12 ++---------- src/device_android.h | 1 - 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/device_android.cpp b/src/device_android.cpp index e6c527f..fb03df7 100644 --- a/src/device_android.cpp +++ b/src/device_android.cpp @@ -25,7 +25,6 @@ namespace audiere { { m_buffer_size = buffer_size; m_buffer = new char [buffer_size]; - AGAudioSetReadCallback(dataReadCallback, this); } @@ -37,14 +36,6 @@ namespace audiere { } - void - AndroidAudioDevice::dataReadCallback(void* arg) { - AndroidAudioDevice* device = static_cast(arg); - if (!device) - return; - device->writeData(); - } - void AndroidAudioDevice::writeData() { int sample_len; @@ -61,7 +52,8 @@ namespace audiere { void AndroidAudioDevice::update() { - AI_Sleep(10); + AI_Sleep(1); + writeData(); } const char* ADR_CALL diff --git a/src/device_android.h b/src/device_android.h index aa28e1c..2c469ca 100644 --- a/src/device_android.h +++ b/src/device_android.h @@ -27,7 +27,6 @@ namespace audiere { int m_rate; void writeData(); - static void dataReadCallback(void*); }; } -- cgit v1.2.3