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

Commit 913c46b9 authored by Andy Hung's avatar Andy Hung Committed by Gerrit Code Review
Browse files

Merge "SoundPool: Enable multithreaded track start" into main

parents 156bb5fd b9faaa33
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -35,10 +35,9 @@ static constexpr int32_t kMaxStreams = 32;
// In R, we change this to true, as it is the correct way per SoundPool documentation.
static constexpr bool kStealActiveStream_OldestFirst = true;

// kPlayOnCallingThread = true prior to R.
// Changing to false means calls to play() are almost instantaneous instead of taking around
// ~10ms to launch the AudioTrack. It is perhaps 100x faster.
static constexpr bool kPlayOnCallingThread = true;
static constexpr bool kPlayOnCallingThread = false;

// Amount of time for a StreamManager thread to wait before closing.
static constexpr int64_t kWaitTimeBeforeCloseNs = 9 * NANOS_PER_SECOND;
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ class JavaThread {
public:
    JavaThread(std::function<void()> f, const char *name)
        : mF{std::move(f)} {
        createThreadEtc(staticFunction, this, name);
        createThreadEtc(staticFunction, this, name, ANDROID_PRIORITY_AUDIO);
    }

    JavaThread(JavaThread &&) = delete; // uses "this" ptr, not moveable.