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 <christian.stromme@digia.com>
This commit is contained in:
Yoann Lopes
2014-05-09 17:21:29 +02:00
parent 85f4b8177c
commit f935715767

View File

@@ -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 {