diff options
author | Luo Jinghua <sunmoon1997@gmail.com> | 2011-12-07 13:46:47 +0800 |
---|---|---|
committer | Luo Jinghua <sunmoon1997@gmail.com> | 2011-12-07 13:46:47 +0800 |
commit | b48c05fd9b6a3f8fc5333499251e4d526e5c4faa (patch) | |
tree | b3bd563f7bda4d93831a1d9737ed2a0f344bb614 | |
parent | 0d1bc88013adf5770c1329bfd9eb97710462d460 (diff) |
Switch android device to push mode
-rw-r--r-- | src/device_android.cpp | 12 | ||||
-rw-r--r-- | 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); } @@ -38,14 +37,6 @@ namespace audiere { void - AndroidAudioDevice::dataReadCallback(void* arg) { - AndroidAudioDevice* device = static_cast<AndroidAudioDevice*>(arg); - if (!device) - return; - device->writeData(); - } - - void AndroidAudioDevice::writeData() { int sample_len; size_t sample_left; @@ -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*); }; } |