From f935715767b6bfcc603128c61adc01c2c68a8e31 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Fri, 9 May 2014 17:21:29 +0200 Subject: [PATCH] AVFoundation: correctly pass output URLs to AVCaptureMovieFileOutput. The URL string passed to NSURL was not fully encoded, causing the recorder to start with a nil URL, leading to an exception. We now use QURL::toNSURL() which automatically encode the URL. Task-number: QTBUG-38668 Change-Id: I06bf881a0a25fb37efd8784ebf518c8b90ecc6b4 Reviewed-by: Christian Stromme --- src/plugins/avfoundation/camera/avfmediarecordercontrol.mm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm b/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm index 4e82ada..d65d238 100644 --- a/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm +++ b/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm @@ -250,10 +250,8 @@ void AVFMediaRecorderControl::setState(QMediaRecorder::State state) qDebugCamera() << "Video capture location:" << actualLocation.toString(); - NSString *urlString = [NSString stringWithUTF8String:actualLocation.toString().toUtf8().constData()]; - NSURL *fileURL = [NSURL URLWithString:urlString]; - - [m_movieOutput startRecordingToOutputFileURL:fileURL recordingDelegate:m_recorderDelagate]; + [m_movieOutput startRecordingToOutputFileURL:actualLocation.toNSURL() + recordingDelegate:m_recorderDelagate]; Q_EMIT actualLocationChanged(actualLocation); } else { -- 2.7.4