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

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

Merge "AudioTrack write() on a full buffer while paused returns 0"

parents d91f8af4 9b53db37
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -520,6 +520,10 @@ jint writeToTrack(const sp<AudioTrack>& track, jint audioFormat, jbyte* data,
    // regular write() or copy the data to the AudioTrack's shared memory?
    if (track->sharedBuffer() == 0) {
        written = track->write(data + offsetInBytes, sizeInBytes);
        // for compatibility with earlier behavior of write(), return 0 in this case
        if (written == (ssize_t) WOULD_BLOCK) {
            written = 0;
        }
    } else {
        if (audioFormat == javaAudioTrackFields.PCM16) {
            // writing to shared memory, check for capacity