Loading core/jni/Android.mk +4 −2 Original line number Diff line number Diff line Loading @@ -177,7 +177,8 @@ LOCAL_C_INCLUDES += \ external/harfbuzz_ng/src \ external/zlib \ frameworks/opt/emoji \ libcore/include libcore/include \ $(call include-path-for, audio-utils) \ LOCAL_SHARED_LIBRARIES := \ libmemtrack \ Loading Loading @@ -213,7 +214,8 @@ LOCAL_SHARED_LIBRARIES := \ libjpeg \ libusbhost \ libharfbuzz_ng \ libz libz \ libaudioutils \ ifeq ($(USE_OPENGL_RENDERER),true) LOCAL_SHARED_LIBRARIES += libhwui Loading core/jni/android_media_AudioTrack.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #include <utils/Log.h> #include <media/AudioSystem.h> #include <media/AudioTrack.h> #include <audio_utils/primitives.h> #include <binder/MemoryHeapBase.h> #include <binder/MemoryBase.h> Loading Loading @@ -550,10 +551,8 @@ jint writeToTrack(const sp<AudioTrack>& track, jint audioFormat, const jbyte* da } int count = sizeInBytes; int16_t *dst = (int16_t *)track->sharedBuffer()->pointer(); const int8_t *src = (const int8_t *)(data + offsetInBytes); while (count--) { *dst++ = (int16_t)(*src++^0x80) << 8; } const uint8_t *src = (const uint8_t *)(data + offsetInBytes); memcpy_to_i16_from_u8(dst, src, count); // even though we wrote 2*sizeInBytes, we only report sizeInBytes as written to hide // the 8bit mixer restriction from the user of this function written = sizeInBytes; Loading Loading
core/jni/Android.mk +4 −2 Original line number Diff line number Diff line Loading @@ -177,7 +177,8 @@ LOCAL_C_INCLUDES += \ external/harfbuzz_ng/src \ external/zlib \ frameworks/opt/emoji \ libcore/include libcore/include \ $(call include-path-for, audio-utils) \ LOCAL_SHARED_LIBRARIES := \ libmemtrack \ Loading Loading @@ -213,7 +214,8 @@ LOCAL_SHARED_LIBRARIES := \ libjpeg \ libusbhost \ libharfbuzz_ng \ libz libz \ libaudioutils \ ifeq ($(USE_OPENGL_RENDERER),true) LOCAL_SHARED_LIBRARIES += libhwui Loading
core/jni/android_media_AudioTrack.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #include <utils/Log.h> #include <media/AudioSystem.h> #include <media/AudioTrack.h> #include <audio_utils/primitives.h> #include <binder/MemoryHeapBase.h> #include <binder/MemoryBase.h> Loading Loading @@ -550,10 +551,8 @@ jint writeToTrack(const sp<AudioTrack>& track, jint audioFormat, const jbyte* da } int count = sizeInBytes; int16_t *dst = (int16_t *)track->sharedBuffer()->pointer(); const int8_t *src = (const int8_t *)(data + offsetInBytes); while (count--) { *dst++ = (int16_t)(*src++^0x80) << 8; } const uint8_t *src = (const uint8_t *)(data + offsetInBytes); memcpy_to_i16_from_u8(dst, src, count); // even though we wrote 2*sizeInBytes, we only report sizeInBytes as written to hide // the 8bit mixer restriction from the user of this function written = sizeInBytes; Loading