diff --git a/audio/2.0/default/StreamIn.cpp b/audio/2.0/default/StreamIn.cpp index 9c933a9201..fea9156f62 100644 --- a/audio/2.0/default/StreamIn.cpp +++ b/audio/2.0/default/StreamIn.cpp @@ -378,9 +378,9 @@ Return StreamIn::prepareForReading(uint32_t frameSize, } // Create and launch the thread. - auto tempReadThread = std::make_unique( - &mStopReadThread, mStream, tempCommandMQ.get(), tempDataMQ.get(), - tempStatusMQ.get(), tempElfGroup.get()); + sp tempReadThread = + new ReadThread(&mStopReadThread, mStream, tempCommandMQ.get(), tempDataMQ.get(), + tempStatusMQ.get(), tempElfGroup.get()); if (!tempReadThread->init()) { ALOGW("failed to start reader thread: %s", strerror(-status)); sendError(Result::INVALID_ARGUMENTS); @@ -396,7 +396,7 @@ Return StreamIn::prepareForReading(uint32_t frameSize, mCommandMQ = std::move(tempCommandMQ); mDataMQ = std::move(tempDataMQ); mStatusMQ = std::move(tempStatusMQ); - mReadThread = tempReadThread.release(); + mReadThread = tempReadThread; mEfGroup = tempElfGroup.release(); threadInfo.pid = getpid(); threadInfo.tid = mReadThread->getTid(); diff --git a/audio/2.0/default/StreamOut.cpp b/audio/2.0/default/StreamOut.cpp index 22dcd0c994..b9eaea8268 100644 --- a/audio/2.0/default/StreamOut.cpp +++ b/audio/2.0/default/StreamOut.cpp @@ -353,9 +353,9 @@ Return StreamOut::prepareForWriting(uint32_t frameSize, } // Create and launch the thread. - auto tempWriteThread = std::make_unique( - &mStopWriteThread, mStream, tempCommandMQ.get(), tempDataMQ.get(), - tempStatusMQ.get(), tempElfGroup.get()); + sp tempWriteThread = + new WriteThread(&mStopWriteThread, mStream, tempCommandMQ.get(), tempDataMQ.get(), + tempStatusMQ.get(), tempElfGroup.get()); if (!tempWriteThread->init()) { ALOGW("failed to start writer thread: %s", strerror(-status)); sendError(Result::INVALID_ARGUMENTS); @@ -371,7 +371,7 @@ Return StreamOut::prepareForWriting(uint32_t frameSize, mCommandMQ = std::move(tempCommandMQ); mDataMQ = std::move(tempDataMQ); mStatusMQ = std::move(tempStatusMQ); - mWriteThread = tempWriteThread.release(); + mWriteThread = tempWriteThread; mEfGroup = tempElfGroup.release(); threadInfo.pid = getpid(); threadInfo.tid = mWriteThread->getTid();