mirror of https://github.com/procxx/kepka.git
fixed crash in recording
This commit is contained in:
parent
5fe1b7b51f
commit
021fbb8ad4
|
@ -2460,6 +2460,8 @@ void HistoryWidget::onRecordError() {
|
|||
}
|
||||
|
||||
void HistoryWidget::onRecordDone(QByteArray result, qint32 samples) {
|
||||
if (!_peer) return;
|
||||
|
||||
App::wnd()->activateWindow();
|
||||
int32 duration = samples / AudioVoiceMsgFrequency;
|
||||
_imageLoader.append(result, duration, _peer->id, replyToId(), ToPrepareAudio);
|
||||
|
@ -2475,7 +2477,7 @@ void HistoryWidget::onRecordUpdate(qint16 level, qint32 samples) {
|
|||
_recordingAnim.start();
|
||||
_recordingSamples = samples;
|
||||
if (samples < 0 || samples >= AudioVoiceMsgFrequency * AudioVoiceMsgMaxLength) {
|
||||
stopRecording(samples > 0 && _inField);
|
||||
stopRecording(_peer && samples > 0 && _inField);
|
||||
}
|
||||
updateField();
|
||||
}
|
||||
|
@ -3588,7 +3590,7 @@ void HistoryWidget::mouseReleaseEvent(QMouseEvent *e) {
|
|||
updateDragAreas();
|
||||
}
|
||||
if (_recording && cHasAudioCapture()) {
|
||||
stopRecording(_inField);
|
||||
stopRecording(_peer && _inField);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue