diff options
author | Christian Strømme <christian.stromme@theqtcompany.com> | 2016-01-12 15:12:24 +0100 |
---|---|---|
committer | Christian Strømme <christian.stromme@theqtcompany.com> | 2016-01-12 15:15:37 +0100 |
commit | 963a534e339c4515f0e1abf85c6e91ec3de145de (patch) | |
tree | d5b291b432a4a8b50cdfb1091392685c0f48a6d5 | |
parent | 9a2fcd06a8ee306f2a90be93640901b9c8197911 (diff) | |
parent | c953ef391086f4b689f6adc6d29cb8021db64845 (diff) | |
download | qtmultimedia-963a534e339c4515f0e1abf85c6e91ec3de145de.tar.gz |
Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: Ia563cf734178b821c2aadda8b79b1f09b17de7cd
-rw-r--r-- | src/multimedia/audio/qsoundeffect_qaudio_p.cpp | 2 | ||||
-rw-r--r-- | src/plugins/android/src/mediacapture/qandroidcapturesession.cpp | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp index e95e4e521..77ed48b4a 100644 --- a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp +++ b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp @@ -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); diff --git a/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp b/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp index d25438ec7..f02016654 100644 --- a/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp +++ b/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp @@ -234,13 +234,15 @@ void QAndroidCaptureSession::start() if (!m_mediaRecorder->prepare()) { emit error(QMediaRecorder::FormatError, QLatin1String("Unable to prepare the media recorder.")); - restartViewfinder(); + if (m_cameraSession) + restartViewfinder(); return; } if (!m_mediaRecorder->start()) { emit error(QMediaRecorder::FormatError, QLatin1String("Unable to start the media recorder.")); - restartViewfinder(); + 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 |