Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: Ia563cf734178b821c2aadda8b79b1f09b17de7cd
This commit is contained in:
@@ -395,6 +395,8 @@ qint64 PrivateSoundSource::readData( char* data, qint64 len)
|
|||||||
memcpy(data + dataOffset, sampleData + m_offset, sampleSize - m_offset);
|
memcpy(data + dataOffset, sampleData + m_offset, sampleSize - m_offset);
|
||||||
bytesWritten += sampleSize - m_offset;
|
bytesWritten += sampleSize - m_offset;
|
||||||
int wrapLen = periodSize - (sampleSize - m_offset);
|
int wrapLen = periodSize - (sampleSize - m_offset);
|
||||||
|
if (wrapLen > sampleSize)
|
||||||
|
wrapLen = sampleSize;
|
||||||
#ifdef QT_QAUDIO_DEBUG
|
#ifdef QT_QAUDIO_DEBUG
|
||||||
qDebug() << "END OF SOUND: bytesWritten=" << bytesWritten << ", offset=" << m_offset
|
qDebug() << "END OF SOUND: bytesWritten=" << bytesWritten << ", offset=" << m_offset
|
||||||
<< ", part1=" << (sampleSize-m_offset);
|
<< ", part1=" << (sampleSize-m_offset);
|
||||||
|
|||||||
@@ -234,13 +234,15 @@ void QAndroidCaptureSession::start()
|
|||||||
|
|
||||||
if (!m_mediaRecorder->prepare()) {
|
if (!m_mediaRecorder->prepare()) {
|
||||||
emit error(QMediaRecorder::FormatError, QLatin1String("Unable to prepare the media recorder."));
|
emit error(QMediaRecorder::FormatError, QLatin1String("Unable to prepare the media recorder."));
|
||||||
restartViewfinder();
|
if (m_cameraSession)
|
||||||
|
restartViewfinder();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_mediaRecorder->start()) {
|
if (!m_mediaRecorder->start()) {
|
||||||
emit error(QMediaRecorder::FormatError, QLatin1String("Unable to start the media recorder."));
|
emit error(QMediaRecorder::FormatError, QLatin1String("Unable to start the media recorder."));
|
||||||
restartViewfinder();
|
if (m_cameraSession)
|
||||||
|
restartViewfinder();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -433,6 +435,9 @@ void QAndroidCaptureSession::updateViewfinder()
|
|||||||
|
|
||||||
void QAndroidCaptureSession::restartViewfinder()
|
void QAndroidCaptureSession::restartViewfinder()
|
||||||
{
|
{
|
||||||
|
if (!m_cameraSession)
|
||||||
|
return;
|
||||||
|
|
||||||
m_cameraSession->camera()->reconnect();
|
m_cameraSession->camera()->reconnect();
|
||||||
|
|
||||||
// This is not necessary on most devices, but it crashes on some if we don't stop the
|
// This is not necessary on most devices, but it crashes on some if we don't stop the
|
||||||
|
|||||||
Reference in New Issue
Block a user