From f252ad92526c73c4df05798a4ab699853908edc2 Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Tue, 7 May 2019 14:40:51 +0200 Subject: AVFoundation: Fix sending proper state in QMediaRecorder Need to send the state if it has been applied. Currently it happens when Recording is requested. If Stopped is requested, the state will be changed in handleRecordingFinished callback. Change-Id: I6911f2cebb2d1cc8a08eee17e7b91654b5d6e4c7 Fixes: QTBUG-75287 Reviewed-by: Andy Shaw --- src/plugins/avfoundation/camera/avfmediarecordercontrol.mm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm b/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm index 546eabf89..a67918bbc 100644 --- a/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm +++ b/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm @@ -294,6 +294,8 @@ void AVFMediaRecorderControl::setState(QMediaRecorder::State state) m_recordingFinished = false; Q_EMIT actualLocationChanged(actualLocation); + updateStatus(); + Q_EMIT stateChanged(m_state); } else { Q_EMIT error(QMediaRecorder::FormatError, tr("Recorder not configured")); } @@ -312,10 +314,6 @@ void AVFMediaRecorderControl::setState(QMediaRecorder::State state) unapplySettings(); } } - - updateStatus(); - if (state != m_state) - Q_EMIT stateChanged(m_state); } void AVFMediaRecorderControl::setMuted(bool muted) -- cgit v1.2.3