aaudio: fix small underflow when a stream is stopped
Also remove inconsequential volume parameter.
Bug: 67910437
Test: test_aaudio_monkey.cpp and write_sine_callback.cpp
Change-Id: I6d11f3bfced3d579440f99c02d01a7d68af5c1e0
diff --git a/services/oboeservice/AAudioMixer.h b/services/oboeservice/AAudioMixer.h
index a8090bc..5625d4d 100644
--- a/services/oboeservice/AAudioMixer.h
+++ b/services/oboeservice/AAudioMixer.h
@@ -33,13 +33,14 @@
/**
* Mix from this FIFO
- * @param fifo
- * @param volume
- * @return true if underflowed
+ * @param streamIndex for marking stream variables in systrace
+ * @param fifo to read from
+ * @param allowUnderflow if true then allow mixer to advance read index past the write index
+ * @return true if actually underflowed
*/
- bool mix(int trackIndex, android::FifoBuffer *fifo, float volume);
+ bool mix(int streamIndex, android::FifoBuffer *fifo, bool allowUnderflow);
- void mixPart(float *destination, float *source, int32_t numFrames, float volume);
+ void mixPart(float *destination, float *source, int32_t numFrames);
float *getOutputBuffer();
@@ -50,5 +51,4 @@
int32_t mBufferSizeInBytes = 0;
};
-
#endif //AAUDIO_AAUDIO_MIXER_H