mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Fix MediaRecorder crash when no data captured.
This commit is contained in:
committed by
Greyson Parrelli
parent
8968ef1b85
commit
ae40a65924
@@ -37,8 +37,17 @@ public class MediaRecorderWrapper implements Recorder {
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
recorder.stop();
|
||||
recorder.release();
|
||||
recorder = null;
|
||||
try {
|
||||
recorder.stop();
|
||||
} catch (RuntimeException e) {
|
||||
if (e.getClass() != RuntimeException.class) {
|
||||
throw e;
|
||||
} else {
|
||||
Log.d(TAG, "Recording stopped with no data captured.");
|
||||
}
|
||||
} finally {
|
||||
recorder.release();
|
||||
recorder = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user