Merge remote-tracking branch 'origin/5.5' into 5.6

Change-Id: Ia563cf734178b821c2aadda8b79b1f09b17de7cd
This commit is contained in:
Christian Strømme
2016-01-12 15:12:24 +01:00
2 changed files with 9 additions and 2 deletions

View File

@@ -395,6 +395,8 @@ qint64 PrivateSoundSource::readData( char* data, qint64 len)
memcpy(data + dataOffset, sampleData + m_offset, sampleSize - m_offset);
bytesWritten += sampleSize - m_offset;
int wrapLen = periodSize - (sampleSize - m_offset);
if (wrapLen > sampleSize)
wrapLen = sampleSize;
#ifdef QT_QAUDIO_DEBUG
qDebug() << "END OF SOUND: bytesWritten=" << bytesWritten << ", offset=" << m_offset
<< ", part1=" << (sampleSize-m_offset);

View File

@@ -234,12 +234,14 @@ void QAndroidCaptureSession::start()
if (!m_mediaRecorder->prepare()) {
emit error(QMediaRecorder::FormatError, QLatin1String("Unable to prepare the media recorder."));
if (m_cameraSession)
restartViewfinder();
return;
}
if (!m_mediaRecorder->start()) {
emit error(QMediaRecorder::FormatError, QLatin1String("Unable to start the media recorder."));
if (m_cameraSession)
restartViewfinder();
return;
}
@@ -433,6 +435,9 @@ void QAndroidCaptureSession::updateViewfinder()
void QAndroidCaptureSession::restartViewfinder()
{
if (!m_cameraSession)
return;
m_cameraSession->camera()->reconnect();
// This is not necessary on most devices, but it crashes on some if we don't stop the