Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ad3afe5 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Return correct status for android.media.AudioRecord.read(short[]...)"

parents d1233575 3f0af8be
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -402,10 +402,13 @@ static jint android_media_AudioRecord_readInShortArray(JNIEnv *env, jobject thi
                                                        jshortArray javaAudioData,
                                                        jint offsetInShorts, jint sizeInShorts) {

    return (android_media_AudioRecord_readInByteArray(env, thiz,
    jint read = android_media_AudioRecord_readInByteArray(env, thiz,
                                                        (jbyteArray) javaAudioData,
                                                        offsetInShorts*2, sizeInShorts*2)
            / 2);
                                                        offsetInShorts*2, sizeInShorts*2);
    if (read > 0) {
        read /= 2;
    }
    return read;
}

// ----------------------------------------------------------------------------