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

Commit a9038800 authored by Ricardo Garcia's avatar Ricardo Garcia Committed by Android (Google) Code Review
Browse files

Merge "Remove force argument to ensure mCaptureThread exit within Visualizer...

Merge "Remove force argument to ensure mCaptureThread exit within Visualizer destructor" into nyc-mr1-dev
parents a246f6dc 2e5b5704
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -95,8 +95,7 @@ public:

    // install a callback to receive periodic captures. The capture rate is specified in milliHertz
    // and the capture format is according to flags  (see callback_flags).
    status_t setCaptureCallBack(capture_cbk_t cbk, void* user, uint32_t flags, uint32_t rate,
                                bool force = false);
    status_t setCaptureCallBack(capture_cbk_t cbk, void* user, uint32_t flags, uint32_t rate);

    // set the capture size capture size must be a power of two in the range
    // [VISUALIZER_CAPTURE_SIZE_MAX. VISUALIZER_CAPTURE_SIZE_MIN]
+8 −10
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ Visualizer::~Visualizer()
{
    ALOGV("Visualizer::~Visualizer()");
    setEnabled(false);
    setCaptureCallBack(NULL, NULL, 0, 0, true);
    setCaptureCallBack(NULL, NULL, 0, 0);
}

status_t Visualizer::setEnabled(bool enabled)
@@ -77,15 +77,13 @@ status_t Visualizer::setEnabled(bool enabled)

    status_t status = AudioEffect::setEnabled(enabled);

    if (status == NO_ERROR) {
    if (t != 0) {
            if (enabled) {
        if (enabled && status == NO_ERROR) {
            t->run("Visualizer");
        } else {
            t->requestExit();
        }
    }
    }

    if (t != 0) {
        t->mLock.unlock();
@@ -95,14 +93,14 @@ status_t Visualizer::setEnabled(bool enabled)
}

status_t Visualizer::setCaptureCallBack(capture_cbk_t cbk, void* user, uint32_t flags,
        uint32_t rate, bool force)
        uint32_t rate)
{
    if (rate > CAPTURE_RATE_MAX) {
        return BAD_VALUE;
    }
    Mutex::Autolock _l(mCaptureLock);

    if (force || mEnabled) {
    if (mEnabled) {
        return INVALID_OPERATION;
    }