Loading media/libaaudio/src/client/AudioStreamInternalCapture.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -214,6 +214,8 @@ aaudio_result_t AudioStreamInternalCapture::readNowWithConversion(void *buffer, int32_t framesAvailableInWrappingBuffer = totalFramesInWrappingBuffer; uint8_t *currentWrappingBuffer = (uint8_t *) wrappingBuffer.data[partIndex]; if (framesAvailableInWrappingBuffer <= 0) break; // Put data from the wrapping buffer into the flowgraph 8 frames at a time. // Continuously pull as much data as possible from the flowgraph into the byte buffer. // The return value of mFlowGraph.process is the number of frames actually pulled. Loading media/libaaudio/src/client/AudioStreamInternalPlay.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -258,14 +258,20 @@ aaudio_result_t AudioStreamInternalPlay::writeNowWithConversion(const void *buff currentWrappingBuffer += numBytesActuallyWrittenToWrappingBuffer; framesAvailableInWrappingBuffer -= framesActuallyWrittenToWrappingBuffer; framesWrittenToAudioEndpoint += framesActuallyWrittenToWrappingBuffer; } else { break; } // Put data from byteBuffer into the flowgraph one buffer (8 frames) at a time. // Continuously pull as much data as possible from the flowgraph into the wrapping buffer. // The return value of mFlowGraph.process is the number of frames actually pulled. while (framesAvailableInWrappingBuffer > 0 && framesLeftInByteBuffer > 0) { const int32_t framesToWriteFromByteBuffer = std::min(flowgraph::kDefaultBufferSize, int32_t framesToWriteFromByteBuffer = std::min(flowgraph::kDefaultBufferSize, framesLeftInByteBuffer); // If the wrapping buffer is running low, write one frame at a time. if (framesAvailableInWrappingBuffer < flowgraph::kDefaultBufferSize) { framesToWriteFromByteBuffer = 1; } const int32_t numBytesToWriteFromByteBuffer = getBytesPerFrame() * framesToWriteFromByteBuffer; Loading Loading
media/libaaudio/src/client/AudioStreamInternalCapture.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -214,6 +214,8 @@ aaudio_result_t AudioStreamInternalCapture::readNowWithConversion(void *buffer, int32_t framesAvailableInWrappingBuffer = totalFramesInWrappingBuffer; uint8_t *currentWrappingBuffer = (uint8_t *) wrappingBuffer.data[partIndex]; if (framesAvailableInWrappingBuffer <= 0) break; // Put data from the wrapping buffer into the flowgraph 8 frames at a time. // Continuously pull as much data as possible from the flowgraph into the byte buffer. // The return value of mFlowGraph.process is the number of frames actually pulled. Loading
media/libaaudio/src/client/AudioStreamInternalPlay.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -258,14 +258,20 @@ aaudio_result_t AudioStreamInternalPlay::writeNowWithConversion(const void *buff currentWrappingBuffer += numBytesActuallyWrittenToWrappingBuffer; framesAvailableInWrappingBuffer -= framesActuallyWrittenToWrappingBuffer; framesWrittenToAudioEndpoint += framesActuallyWrittenToWrappingBuffer; } else { break; } // Put data from byteBuffer into the flowgraph one buffer (8 frames) at a time. // Continuously pull as much data as possible from the flowgraph into the wrapping buffer. // The return value of mFlowGraph.process is the number of frames actually pulled. while (framesAvailableInWrappingBuffer > 0 && framesLeftInByteBuffer > 0) { const int32_t framesToWriteFromByteBuffer = std::min(flowgraph::kDefaultBufferSize, int32_t framesToWriteFromByteBuffer = std::min(flowgraph::kDefaultBufferSize, framesLeftInByteBuffer); // If the wrapping buffer is running low, write one frame at a time. if (framesAvailableInWrappingBuffer < flowgraph::kDefaultBufferSize) { framesToWriteFromByteBuffer = 1; } const int32_t numBytesToWriteFromByteBuffer = getBytesPerFrame() * framesToWriteFromByteBuffer; Loading