summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf2
-rw-r--r--src/multimedia/audio/qwavedecoder_p.cpp8
-rw-r--r--src/plugins/m3u/qm3uhandler.cpp10
-rw-r--r--tests/auto/cmake/CMakeLists.txt13
-rwxr-xr-xtests/auto/integration/qaudioinput/tst_qaudioinput.cpp4
-rw-r--r--tests/auto/unit/qwavedecoder/data/isawav_1_16_44100_le_2.wavbin0 -> 22096 bytes
-rw-r--r--tests/auto/unit/qwavedecoder/tst_qwavedecoder.cpp2
7 files changed, 26 insertions, 13 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 02554aba2..6aa780ca2 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -1,4 +1,4 @@
load(qt_build_config)
CONFIG += qt_example_installs
-MODULE_VERSION = 5.0.2
+MODULE_VERSION = 5.1.0
diff --git a/src/multimedia/audio/qwavedecoder_p.cpp b/src/multimedia/audio/qwavedecoder_p.cpp
index 4b036b201..b75bfaf8f 100644
--- a/src/multimedia/audio/qwavedecoder_p.cpp
+++ b/src/multimedia/audio/qwavedecoder_p.cpp
@@ -153,13 +153,15 @@ void QWaveDecoder::handleData()
chunk descriptor;
peekChunk(&descriptor);
- if (source->bytesAvailable() < qint64(descriptor.size + sizeof(chunk)))
+ quint32 rawChunkSize = descriptor.size + sizeof(chunk);
+ if (source->bytesAvailable() < qint64(rawChunkSize))
return;
WAVEHeader wave;
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
if (bigEndian) {
diff --git a/src/plugins/m3u/qm3uhandler.cpp b/src/plugins/m3u/qm3uhandler.cpp
index 6dd3fae3d..b2e17fc49 100644
--- a/src/plugins/m3u/qm3uhandler.cpp
+++ b/src/plugins/m3u/qm3uhandler.cpp
@@ -190,7 +190,7 @@ QM3uPlaylistPlugin::~QM3uPlaylistPlugin()
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
@@ -198,18 +198,18 @@ bool QM3uPlaylistPlugin::canRead(const QUrl& location, const QByteArray &format)
if (!QFileInfo(location.toLocalFile()).isReadable())
return false;
- if (format == "m3u")
+ if (format == "m3u" || format == "m3u8")
return true;
if (!format.isEmpty())
return false;
- else
- return location.toLocalFile().toLower().endsWith(QLatin1String("m3u"));
+ QString localFile = location.toLocalFile().toLower();
+ return localFile.endsWith(QLatin1String("m3u")) || localFile.endsWith(QLatin1String("m3u8"));
}
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)
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 5d23068d8..a634b9dec 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -9,7 +9,16 @@ find_package(Qt5Core REQUIRED)
include("${_Qt5CTestMacros}")
+set(qt_module_includes
+ Multimedia QCamera
+)
+
+if (NOT NO_WIDGETS)
+ list(APPEND qt_module_includes
+ MultimediaWidgets QVideoWidget
+ )
+endif()
+
test_module_includes(
- Multimedia QCamera
- MultimediaWidgets QVideoWidget
+ ${qt_module_includes}
)
diff --git a/tests/auto/integration/qaudioinput/tst_qaudioinput.cpp b/tests/auto/integration/qaudioinput/tst_qaudioinput.cpp
index c30a1aa34..9fb4dcbf3 100755
--- a/tests/auto/integration/qaudioinput/tst_qaudioinput.cpp
+++ b/tests/auto/integration/qaudioinput/tst_qaudioinput.cpp
@@ -631,7 +631,7 @@ void tst_QAudioInput::push()
QVERIFY(wavHeader.write(*audioFile));
// Set a large buffer to avoid underruns during QTest::qWaits
- audioInput.setBufferSize(128*1024);
+ audioInput.setBufferSize(audioFormat.bytesForDuration(1000000));
QIODevice* feed = audioInput.start();
@@ -699,7 +699,7 @@ void tst_QAudioInput::pushSuspendResume()
QAudioInput audioInput(audioFormat, this);
audioInput.setNotifyInterval(100);
- audioInput.setBufferSize(128*1024);
+ audioInput.setBufferSize(audioFormat.bytesForDuration(1000000));
QSignalSpy notifySignal(&audioInput, SIGNAL(notify()));
QSignalSpy stateSignal(&audioInput, SIGNAL(stateChanged(QAudio::State)));
diff --git a/tests/auto/unit/qwavedecoder/data/isawav_1_16_44100_le_2.wav b/tests/auto/unit/qwavedecoder/data/isawav_1_16_44100_le_2.wav
new file mode 100644
index 000000000..087e68e82
--- /dev/null
+++ b/tests/auto/unit/qwavedecoder/data/isawav_1_16_44100_le_2.wav
Binary files differ
diff --git a/tests/auto/unit/qwavedecoder/tst_qwavedecoder.cpp b/tests/auto/unit/qwavedecoder/tst_qwavedecoder.cpp
index c74fb51ae..494737223 100644
--- a/tests/auto/unit/qwavedecoder/tst_qwavedecoder.cpp
+++ b/tests/auto/unit/qwavedecoder/tst_qwavedecoder.cpp
@@ -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_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;
+ // 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
QTest::newRow("File isawav_1_32_8000_le.wav") << testFilePath("isawav_1_32_8000_le.wav") << tst_QWaveDecoder::FormatDescriptor << 1 << 32 << 8000 << QAudioFormat::LittleEndian;