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

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

Merge "Fix format conversion in DuplicatingThread" into lmp-mr1-dev

parents 7966142a ec0eeafa
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -4694,7 +4694,6 @@ void AudioFlinger::DuplicatingThread::threadLoop_sleepTime()

ssize_t AudioFlinger::DuplicatingThread::threadLoop_write()
{
    for (size_t i = 0; i < outputTracks.size(); i++) {
    // We convert the duplicating thread format to AUDIO_FORMAT_PCM_16_BIT
    // for delivery downstream as needed. This in-place conversion is safe as
    // AUDIO_FORMAT_PCM_16_BIT is smaller than any other supported format
@@ -4703,6 +4702,7 @@ ssize_t AudioFlinger::DuplicatingThread::threadLoop_write()
        memcpy_by_audio_format(mSinkBuffer, AUDIO_FORMAT_PCM_16_BIT,
                               mSinkBuffer, mFormat, writeFrames * mChannelCount);
    }
    for (size_t i = 0; i < outputTracks.size(); i++) {
        outputTracks[i]->write(reinterpret_cast<int16_t*>(mSinkBuffer), writeFrames);
    }
    mStandby = false;