Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Append, don't replace, previous input on new input.
Previously, we were overwriting the incoming data buffer (input_data_) each time the input stream called onDataIn(). Instead, append the new data to the existing data, so that we don’t lose data if the callback is called more than once before we can process the data. When processing the data, only lock the input_data_ buffer long enough to copy its data to a local variable, rather than for all of the processing. On pause or resume, lock on the input_data_ buffer before clearing it.
- Loading branch information