diff --git a/audio/core/all-versions/default/StreamIn.cpp b/audio/core/all-versions/default/StreamIn.cpp index 599f3c396e..17621a9acf 100644 --- a/audio/core/all-versions/default/StreamIn.cpp +++ b/audio/core/all-versions/default/StreamIn.cpp @@ -412,9 +412,9 @@ Return StreamIn::prepareForReading(uint32_t frameSize, uint32_t framesCoun } // 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); @@ -430,7 +430,7 @@ Return StreamIn::prepareForReading(uint32_t frameSize, uint32_t framesCoun mCommandMQ = std::move(tempCommandMQ); mDataMQ = std::move(tempDataMQ); mStatusMQ = std::move(tempStatusMQ); - mReadThread = tempReadThread.release(); + mReadThread = tempReadThread; mEfGroup = tempElfGroup.release(); #if MAJOR_VERSION <= 6 threadInfo.pid = getpid(); diff --git a/audio/core/all-versions/default/StreamOut.cpp b/audio/core/all-versions/default/StreamOut.cpp index 4fe6601cd2..c23922dbb6 100644 --- a/audio/core/all-versions/default/StreamOut.cpp +++ b/audio/core/all-versions/default/StreamOut.cpp @@ -398,9 +398,9 @@ Return StreamOut::prepareForWriting(uint32_t frameSize, uint32_t framesCou } // 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); @@ -416,7 +416,7 @@ Return StreamOut::prepareForWriting(uint32_t frameSize, uint32_t framesCou mCommandMQ = std::move(tempCommandMQ); mDataMQ = std::move(tempDataMQ); mStatusMQ = std::move(tempStatusMQ); - mWriteThread = tempWriteThread.release(); + mWriteThread = tempWriteThread; mEfGroup = tempElfGroup.release(); #if MAJOR_VERSION <= 6 threadInfo.pid = getpid();