mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 08:15:02 +00:00
e63c897ec2
The composer emits Start whenever the voice message state is Idle, and the state only leaves Idle once the recorder has produced its first audio buffer. A second tap inside that window started a second recording, which overwrote the output file, re-initialised the encoder while the first one was still encoding, and orphaned the first job together with its AudioReader. The orphan kept the microphone open and kept emitting Recording for the rest of the session, so Stop and Delete appeared to do nothing until the room was left and re-entered, and re-initialising the encoder under an active encode could crash natively. DefaultVoiceRecorder.startRecord now runs under the mutex it already owns and returns early when a recording job exists, so the second start is a no-op: no file, no encoder re-init and no second AudioReader. Relates to https://github.com/element-hq/element-x-android/issues/5780