Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I6b92013d9fb14b11141d1a15c183776b2b3309fa
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
load(qt_build_config)
|
load(qt_build_config)
|
||||||
CONFIG += qt_example_installs
|
CONFIG += qt_example_installs
|
||||||
|
|
||||||
MODULE_VERSION = 5.0.2
|
MODULE_VERSION = 5.1.0
|
||||||
|
|||||||
@@ -153,13 +153,15 @@ void QWaveDecoder::handleData()
|
|||||||
chunk descriptor;
|
chunk descriptor;
|
||||||
peekChunk(&descriptor);
|
peekChunk(&descriptor);
|
||||||
|
|
||||||
if (source->bytesAvailable() < qint64(descriptor.size + sizeof(chunk)))
|
quint32 rawChunkSize = descriptor.size + sizeof(chunk);
|
||||||
|
if (source->bytesAvailable() < qint64(rawChunkSize))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
WAVEHeader wave;
|
WAVEHeader wave;
|
||||||
source->read(reinterpret_cast<char *>(&wave), sizeof(WAVEHeader));
|
source->read(reinterpret_cast<char *>(&wave), sizeof(WAVEHeader));
|
||||||
if (descriptor.size > sizeof(WAVEHeader))
|
|
||||||
discardBytes(descriptor.size - sizeof(WAVEHeader));
|
if (rawChunkSize > sizeof(WAVEHeader))
|
||||||
|
discardBytes(rawChunkSize - sizeof(WAVEHeader));
|
||||||
|
|
||||||
// Swizzle this
|
// Swizzle this
|
||||||
if (bigEndian) {
|
if (bigEndian) {
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ QM3uPlaylistPlugin::~QM3uPlaylistPlugin()
|
|||||||
|
|
||||||
bool QM3uPlaylistPlugin::canRead(QIODevice *device, const QByteArray &format) const
|
bool QM3uPlaylistPlugin::canRead(QIODevice *device, const QByteArray &format) const
|
||||||
{
|
{
|
||||||
return device->isReadable() && (format == "m3u" || format.isEmpty());
|
return device->isReadable() && (format == "m3u" || format == "m3u8" || format.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QM3uPlaylistPlugin::canRead(const QUrl& location, const QByteArray &format) const
|
bool QM3uPlaylistPlugin::canRead(const QUrl& location, const QByteArray &format) const
|
||||||
@@ -198,18 +198,18 @@ bool QM3uPlaylistPlugin::canRead(const QUrl& location, const QByteArray &format)
|
|||||||
if (!QFileInfo(location.toLocalFile()).isReadable())
|
if (!QFileInfo(location.toLocalFile()).isReadable())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (format == "m3u")
|
if (format == "m3u" || format == "m3u8")
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!format.isEmpty())
|
if (!format.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
else
|
QString localFile = location.toLocalFile().toLower();
|
||||||
return location.toLocalFile().toLower().endsWith(QLatin1String("m3u"));
|
return localFile.endsWith(QLatin1String("m3u")) || localFile.endsWith(QLatin1String("m3u8"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QM3uPlaylistPlugin::canWrite(QIODevice *device, const QByteArray &format) const
|
bool QM3uPlaylistPlugin::canWrite(QIODevice *device, const QByteArray &format) const
|
||||||
{
|
{
|
||||||
return device->isOpen() && device->isWritable() && format == "m3u";
|
return device->isOpen() && device->isWritable() && (format == "m3u" || format == "m3u8");
|
||||||
}
|
}
|
||||||
|
|
||||||
QMediaPlaylistReader *QM3uPlaylistPlugin::createReader(QIODevice *device, const QByteArray &format)
|
QMediaPlaylistReader *QM3uPlaylistPlugin::createReader(QIODevice *device, const QByteArray &format)
|
||||||
|
|||||||
@@ -9,7 +9,16 @@ find_package(Qt5Core REQUIRED)
|
|||||||
|
|
||||||
include("${_Qt5CTestMacros}")
|
include("${_Qt5CTestMacros}")
|
||||||
|
|
||||||
test_module_includes(
|
set(qt_module_includes
|
||||||
Multimedia QCamera
|
Multimedia QCamera
|
||||||
MultimediaWidgets QVideoWidget
|
)
|
||||||
|
|
||||||
|
if (NOT NO_WIDGETS)
|
||||||
|
list(APPEND qt_module_includes
|
||||||
|
MultimediaWidgets QVideoWidget
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
test_module_includes(
|
||||||
|
${qt_module_includes}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -631,7 +631,7 @@ void tst_QAudioInput::push()
|
|||||||
QVERIFY(wavHeader.write(*audioFile));
|
QVERIFY(wavHeader.write(*audioFile));
|
||||||
|
|
||||||
// Set a large buffer to avoid underruns during QTest::qWaits
|
// Set a large buffer to avoid underruns during QTest::qWaits
|
||||||
audioInput.setBufferSize(128*1024);
|
audioInput.setBufferSize(audioFormat.bytesForDuration(1000000));
|
||||||
|
|
||||||
QIODevice* feed = audioInput.start();
|
QIODevice* feed = audioInput.start();
|
||||||
|
|
||||||
@@ -699,7 +699,7 @@ void tst_QAudioInput::pushSuspendResume()
|
|||||||
QAudioInput audioInput(audioFormat, this);
|
QAudioInput audioInput(audioFormat, this);
|
||||||
|
|
||||||
audioInput.setNotifyInterval(100);
|
audioInput.setNotifyInterval(100);
|
||||||
audioInput.setBufferSize(128*1024);
|
audioInput.setBufferSize(audioFormat.bytesForDuration(1000000));
|
||||||
|
|
||||||
QSignalSpy notifySignal(&audioInput, SIGNAL(notify()));
|
QSignalSpy notifySignal(&audioInput, SIGNAL(notify()));
|
||||||
QSignalSpy stateSignal(&audioInput, SIGNAL(stateChanged(QAudio::State)));
|
QSignalSpy stateSignal(&audioInput, SIGNAL(stateChanged(QAudio::State)));
|
||||||
|
|||||||
BIN
tests/auto/unit/qwavedecoder/data/isawav_1_16_44100_le_2.wav
Normal file
BIN
tests/auto/unit/qwavedecoder/data/isawav_1_16_44100_le_2.wav
Normal file
Binary file not shown.
@@ -130,6 +130,8 @@ void tst_QWaveDecoder::file_data()
|
|||||||
QTest::newRow("File isawav_1_16_44100_le.wav") << testFilePath("isawav_1_16_44100_le.wav") << tst_QWaveDecoder::None << 1 << 16 << 44100 << QAudioFormat::LittleEndian;
|
QTest::newRow("File isawav_1_16_44100_le.wav") << testFilePath("isawav_1_16_44100_le.wav") << tst_QWaveDecoder::None << 1 << 16 << 44100 << QAudioFormat::LittleEndian;
|
||||||
QTest::newRow("File isawav_2_16_8000_be.wav") << testFilePath("isawav_2_16_8000_be.wav") << tst_QWaveDecoder::None << 2 << 16 << 8000 << QAudioFormat::BigEndian;
|
QTest::newRow("File isawav_2_16_8000_be.wav") << testFilePath("isawav_2_16_8000_be.wav") << tst_QWaveDecoder::None << 2 << 16 << 8000 << QAudioFormat::BigEndian;
|
||||||
QTest::newRow("File isawav_2_16_44100_be.wav") << testFilePath("isawav_2_16_44100_be.wav") << tst_QWaveDecoder::None << 2 << 16 << 44100 << QAudioFormat::BigEndian;
|
QTest::newRow("File isawav_2_16_44100_be.wav") << testFilePath("isawav_2_16_44100_be.wav") << tst_QWaveDecoder::None << 2 << 16 << 44100 << QAudioFormat::BigEndian;
|
||||||
|
// The next file has extra data in the wave header.
|
||||||
|
QTest::newRow("File isawav_1_16_44100_le_2.wav") << testFilePath("isawav_1_16_44100_le_2.wav") << tst_QWaveDecoder::None << 1 << 16 << 44100 << QAudioFormat::LittleEndian;
|
||||||
|
|
||||||
// 32 bit waves are not supported
|
// 32 bit waves are not supported
|
||||||
QTest::newRow("File isawav_1_32_8000_le.wav") << testFilePath("isawav_1_32_8000_le.wav") << tst_QWaveDecoder::FormatDescriptor << 1 << 32 << 8000 << QAudioFormat::LittleEndian;
|
QTest::newRow("File isawav_1_32_8000_le.wav") << testFilePath("isawav_1_32_8000_le.wav") << tst_QWaveDecoder::FormatDescriptor << 1 << 32 << 8000 << QAudioFormat::LittleEndian;
|
||||||
|
|||||||
Reference in New Issue
Block a user