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

Commit 878fa3cb authored by jiabin's avatar jiabin Committed by Jiabin Huang
Browse files

Update doc for aaudio data callback.

For an input stream, if the app modifies the data on the callback data
buffer directly, undefined behavior may happen. Update the doc to ask
developers to copy data from the callback buffer before doing any
modification.

Bug: 240479229
Test: make
Change-Id: I41088d458eb5532baceffb5376051711000a5e83
parent 952fbe27
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1173,7 +1173,10 @@ typedef int32_t aaudio_data_callback_result_t;
 * in the streams current data format to the audioData buffer.
 *
 * For an input stream, this function should read and process numFrames of data
 * from the audioData buffer.
 * from the audioData buffer. The data in the audioData buffer must not be modified
 * directly. Instead, it should be copied to another buffer before doing any modification.
 * In many cases, writing to the audioData buffer of an input stream will result in a
 * native exception.
 *
 * The audio data is passed through the buffer. So do NOT call AAudioStream_read() or
 * AAudioStream_write() on the stream that is making the callback.