summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-04-09 12:23:53 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-04-09 12:23:53 (GMT)
commit850c3f7d9bb5fbad041dd935d1d53c5d49db0163 (patch)
tree3ebb00088919d21c51c34b3c002c41b3fd1bedbe /src
parent19a566f82a7c684423331a8caab70ec594afd1ce (diff)
parent64a360f45ab9a1c50ca628cfd6b670b93816c756 (diff)
downloadQt-850c3f7d9bb5fbad041dd935d1d53c5d49db0163.zip
Qt-850c3f7d9bb5fbad041dd935d1d53c5d49db0163.tar.gz
Qt-850c3f7d9bb5fbad041dd935d1d53c5d49db0163.tar.bz2
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts: src/multimedia/audio/qaudioinput_win32_p.h
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.cpp13
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.h2
-rw-r--r--src/3rdparty/phonon/mmf/videoplayer_dsa.cpp2
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog14
-rw-r--r--src/3rdparty/webkit/WebCore/platform/text/StringHash.h12
-rw-r--r--src/gui/itemviews/qfileiconprovider.cpp6
-rw-r--r--src/gui/kernel/qgridlayout.cpp2
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp1
-rw-r--r--src/gui/kernel/qsoftkeymanager_common_p.h3
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp13
-rw-r--r--src/gui/painting/qbrush.cpp3
-rw-r--r--src/gui/text/qfontengine_s60.cpp30
-rw-r--r--src/gui/text/qfontengine_s60_p.h2
-rw-r--r--src/gui/text/qtextengine.cpp2
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp74
-rw-r--r--src/multimedia/audio/qaudioinput_alsa_p.cpp1
-rw-r--r--src/multimedia/audio/qaudioinput_win32_p.cpp14
-rw-r--r--src/multimedia/audio/qaudioinput_win32_p.h1
-rw-r--r--src/multimedia/audio/qaudiooutput_alsa_p.cpp2
-rw-r--r--src/multimedia/audio/qaudiooutput_win32_p.cpp8
-rw-r--r--src/multimedia/audio/qaudiooutput_win32_p.h2
-rw-r--r--src/network/access/qnetworkdiskcache.cpp3
-rw-r--r--src/network/access/qnetworkdiskcache_p.h4
-rw-r--r--src/opengl/qglshaderprogram.cpp19
25 files changed, 178 insertions, 57 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
index 544762a..6356c21 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
@@ -369,6 +369,13 @@ void MMF::AbstractMediaPlayer::playbackComplete(int error)
{
stopTimers();
+ if (KErrNone == error && !m_aboutToFinishSent) {
+ const qint64 total = totalTime();
+ emit MMF::AbstractPlayer::tick(total);
+ m_aboutToFinishSent = true;
+ emit aboutToFinish();
+ }
+
if (KErrNone == error) {
changeState(StoppedState);
@@ -393,15 +400,13 @@ qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds
void MMF::AbstractMediaPlayer::positionTick()
{
- emitMarksIfReached();
-
const qint64 current = currentTime();
+ emitMarksIfReached(current);
emit MMF::AbstractPlayer::tick(current);
}
-void MMF::AbstractMediaPlayer::emitMarksIfReached()
+void MMF::AbstractMediaPlayer::emitMarksIfReached(qint64 current)
{
- const qint64 current = currentTime();
const qint64 total = totalTime();
const qint64 remaining = total - current;
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
index abd6bff..308b5af 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
@@ -91,7 +91,7 @@ private:
void stopBufferStatusTimer();
void stopTimers();
void doVolumeChanged();
- void emitMarksIfReached();
+ void emitMarksIfReached(qint64 position);
void resetMarksIfRewound();
private Q_SLOTS:
diff --git a/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp b/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp
index 226d079..d607f1d 100644
--- a/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp
+++ b/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp
@@ -217,7 +217,7 @@ void getDsaRegion(RWsSession &session, const RWindowBase &window)
void MMF::DsaVideoPlayer::handleParametersChanged(VideoParameters parameters)
{
TRACE_CONTEXT(DsaVideoPlayer::handleParametersChanged, EVideoInternal);
- TRACE_ENTRY("parameters 0x%x", parameters);
+ TRACE_ENTRY("parameters 0x%x", parameters.operator int());
if (!m_window)
return;
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 4de7ad8..45608c5 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -8,4 +8,4 @@ The commit imported was from the
and has the sha1 checksum
- ecfa4583e573ce4dff1f0df12f6bdba3022376e5
+ e3dc4ef2b801d91e115c54f833fa7766d392ceda
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 2bd506b..a2bd5c3 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2009-11-15 Dave Tapuska <dtapuska@rim.com>
+
+ Reviewed by George Staikos.
+
+ Compare UChars single unit at a time as opposed to the uint32_t
+ approach as casting to unaligned addresses may cause a bus failure
+ on ARMv5 and below. This change replicates the same defines that
+ exists in AtomicString.cpp
+
+ https://bugs.webkit.org/show_bug.cgi?id=31475
+
+ * platform/text/StringHash.h:
+ (WebCore::StringHash::equal):
+
2010-03-25 yael aharon <yael.aharon@nokia.com>
Reviewed by Laszlo Gombos.
diff --git a/src/3rdparty/webkit/WebCore/platform/text/StringHash.h b/src/3rdparty/webkit/WebCore/platform/text/StringHash.h
index 336dce3..5d01ea8 100644
--- a/src/3rdparty/webkit/WebCore/platform/text/StringHash.h
+++ b/src/3rdparty/webkit/WebCore/platform/text/StringHash.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved
+ * Copyright (C) Research In Motion Limited 2009. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -47,6 +48,16 @@ namespace WebCore {
if (aLength != bLength)
return false;
+#if PLATFORM(ARM) || PLATFORM(SH4)
+ const UChar* aChars = a->characters();
+ const UChar* bChars = b->characters();
+ for (unsigned i = 0; i != aLength; ++i) {
+ if (*aChars++ != *bChars++)
+ return false;
+ }
+ return true;
+#else
+ /* Do it 4-bytes-at-a-time on architectures where it's safe */
const uint32_t* aChars = reinterpret_cast<const uint32_t*>(a->characters());
const uint32_t* bChars = reinterpret_cast<const uint32_t*>(b->characters());
@@ -59,6 +70,7 @@ namespace WebCore {
return false;
return true;
+#endif
}
static unsigned hash(const RefPtr<StringImpl>& key) { return key->hash(); }
diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp
index f321ab3..5dbd1f0 100644
--- a/src/gui/itemviews/qfileiconprovider.cpp
+++ b/src/gui/itemviews/qfileiconprovider.cpp
@@ -254,7 +254,9 @@ QIcon QFileIconProviderPrivate::getWinIcon(const QFileInfo &fileInfo) const
val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(), 0, &info,
sizeof(SHFILEINFO), SHGFI_SMALLICON|SHGFI_SYSICONINDEX);
#endif
- if (val) {
+
+ // Even if GetFileInfo returns a valid result, hIcon can be empty in some cases
+ if (val && info.hIcon) {
if (fileInfo.isDir() && !fileInfo.isRoot()) {
//using the unique icon index provided by windows save us from duplicate keys
key = QString::fromLatin1("qt_dir_%1").arg(info.iIcon);
@@ -293,7 +295,7 @@ QIcon QFileIconProviderPrivate::getWinIcon(const QFileInfo &fileInfo) const
val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(), 0, &info,
sizeof(SHFILEINFO), SHGFI_LARGEICON|SHGFI_SYSICONINDEX);
#endif
- if (val) {
+ if (val && info.hIcon) {
if (fileInfo.isDir() && !fileInfo.isRoot()) {
//using the unique icon index provided by windows save us from duplicate keys
key = QString::fromLatin1("qt_dir_%1").arg(info.iIcon);
diff --git a/src/gui/kernel/qgridlayout.cpp b/src/gui/kernel/qgridlayout.cpp
index dbd3c01..81a4d04 100644
--- a/src/gui/kernel/qgridlayout.cpp
+++ b/src/gui/kernel/qgridlayout.cpp
@@ -1852,7 +1852,7 @@ void QGridLayout::invalidate()
/*!
\fn int QGridLayout::colSpacing(int col) const
- Use columnSpacing() instead.
+ Use columnMinimumWidth() instead.
*/
/*!
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 923144a..23f1481 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -242,6 +242,7 @@ bool QSoftKeyManager::handleUpdateSoftKeys()
d->requestedSoftKeyActions.clear();
bool recursiveMerging = false;
QWidget *source = softkeySource(NULL, recursiveMerging);
+ d->initialSoftKeySource = source;
while (source) {
if (appendSoftkeys(*source, level))
++level;
diff --git a/src/gui/kernel/qsoftkeymanager_common_p.h b/src/gui/kernel/qsoftkeymanager_common_p.h
index 460d0dc..04ddf7d 100644
--- a/src/gui/kernel/qsoftkeymanager_common_p.h
+++ b/src/gui/kernel/qsoftkeymanager_common_p.h
@@ -70,6 +70,7 @@ protected:
static QSoftKeyManager *self;
QHash<QAction*, Qt::Key> keyedActions;
QMultiHash<int, QAction*> requestedSoftKeyActions;
+ QWidget *initialSoftKeySource;
};
@@ -79,4 +80,4 @@ QT_END_NAMESPACE
QT_END_HEADER
-#endif // QSOFTKEYMANAGER_COMMON_P_H \ No newline at end of file
+#endif // QSOFTKEYMANAGER_COMMON_P_H
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index 9812d72..7d643c2 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -312,17 +312,8 @@ bool QSoftKeyManagerPrivateS60::setMiddleSoftkey(CEikButtonGroupContainer &cba)
bool QSoftKeyManagerPrivateS60::setRightSoftkey(CEikButtonGroupContainer &cba)
{
if (!setSoftkey(cba, QAction::NegativeSoftKey, RSK_POSITION)) {
- Qt::WindowType windowType = Qt::Window;
- QAction *action = requestedSoftKeyActions.value(0);
- if (action) {
- QWidget *actionParent = action->parentWidget();
- Q_ASSERT_X(actionParent, Q_FUNC_INFO, "No parent set for softkey action!");
-
- QWidget *actionWindow = actionParent->window();
- Q_ASSERT_X(actionWindow, Q_FUNC_INFO, "Softkey action does not have window!");
- windowType = actionWindow->windowType();
- }
-
+ const Qt::WindowType windowType = initialSoftKeySource
+ ? initialSoftKeySource->window()->windowType() : Qt::Window;
if (windowType != Qt::Dialog && windowType != Qt::Popup) {
QString text(QSoftKeyManager::tr("Exit"));
TPtrC nativeText = qt_QString2TPtrC(text);
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index a82d0f9..182cce9 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -989,7 +989,8 @@ QDebug operator<<(QDebug dbg, const QBrush &b)
"LinearGradientPattern",
"RadialGradientPattern",
"ConicalGradientPattern",
- "TexturePattern"
+ 0, 0, 0, 0, 0, 0,
+ "TexturePattern" // 24
};
dbg.nospace() << "QBrush(" << b.color() << ',' << BRUSH_STYLES[b.style()] << ')';
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp
index 3ea084b..c9ff661 100644
--- a/src/gui/text/qfontengine_s60.cpp
+++ b/src/gui/text/qfontengine_s60.cpp
@@ -79,6 +79,31 @@ QByteArray QFontEngineS60Extensions::getSfntTable(uint tag) const
return result;
}
+bool QFontEngineS60Extensions::getSfntTableData(uint tag, uchar *buffer, uint *length) const
+{
+ if (!m_trueTypeExtension->HasTrueTypeTable(tag))
+ return false;
+
+ bool result = true;
+ TInt error = KErrNone;
+ TInt tableByteLength;
+ TAny *table =
+ q_check_ptr(m_trueTypeExtension->GetTrueTypeTable(error, tag, &tableByteLength));
+
+ if (error != KErrNone) {
+ return false;
+ } else if (*length > 0 && *length < tableByteLength) {
+ result = false; // Caller did not allocate enough memory
+ } else {
+ *length = tableByteLength;
+ if (buffer)
+ qMemCopy(buffer, table, tableByteLength);
+ }
+
+ m_trueTypeExtension->ReleaseTrueTypeTable(table);
+ return result;
+}
+
const unsigned char *QFontEngineS60Extensions::cmap() const
{
if (!m_cmap) {
@@ -326,6 +351,11 @@ QByteArray QFontEngineS60::getSfntTable(uint tag) const
return m_extensions->getSfntTable(tag);
}
+bool QFontEngineS60::getSfntTableData(uint tag, uchar *buffer, uint *length) const
+{
+ return m_extensions->getSfntTableData(tag, buffer, length);
+}
+
QFontEngine::Type QFontEngineS60::type() const
{
return QFontEngine::S60FontEngine;
diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h
index 5834cc4..a80af4d 100644
--- a/src/gui/text/qfontengine_s60_p.h
+++ b/src/gui/text/qfontengine_s60_p.h
@@ -69,6 +69,7 @@ public:
QFontEngineS60Extensions(CFont* fontOwner, COpenFont *font);
QByteArray getSfntTable(uint tag) const;
+ bool getSfntTableData(uint tag, uchar *buffer, uint *length) const;
const unsigned char *cmap() const;
QPainterPath glyphOutline(glyph_t glyph) const;
CFont *fontOwner() const;
@@ -106,6 +107,7 @@ public:
qreal minRightBearing() const { return 0; }
QByteArray getSfntTable(uint tag) const;
+ bool getSfntTableData(uint tag, uchar *buffer, uint *length) const;
static qreal pixelsToPoints(qreal pixels, Qt::Orientation orientation = Qt::Horizontal);
static qreal pointsToPixels(qreal points, Qt::Orientation orientation = Qt::Horizontal);
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 7dc2c26..6485966 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1647,7 +1647,7 @@ glyph_metrics_t QTextEngine::boundingBox(int from, int len) const
}
}
- glyph_t glyph = glyphs.glyphs[logClusters[pos + ilen - 1]];
+ glyph_t glyph = glyphs.glyphs[logClusters[ilen - 1]];
glyph_metrics_t gi = fe->boundingBox(glyph);
if (gi.isValid())
gm.width -= qRound(gi.xoff - gi.x - gi.width);
diff --git a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
index 67dc90c..aee0807 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
@@ -78,6 +78,8 @@ QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(QByteArray dev, QAudio::Mode
{
device = QLatin1String(dev);
this->mode = mode;
+
+ updateLists();
}
QAudioDeviceInfoInternal::~QAudioDeviceInfoInternal()
@@ -176,22 +178,70 @@ bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const
// See if what is in settings will work (return value).
bool failed = false;
+ bool match = false;
- // For now, just accept only audio/pcm codec
- if(!format.codec().startsWith(QLatin1String("audio/pcm")))
- failed = true;
+ // check codec
+ for( int i = 0; i < codecz.count(); i++) {
+ if (format.codec() == codecz.at(i))
+ match = true;
+ }
+ if (!match) failed = true;
+
+ // check channel
+ match = false;
+ if (!failed) {
+ for( int i = 0; i < channelz.count(); i++) {
+ if (format.channels() == channelz.at(i)) {
+ match = true;
+ break;
+ }
+ }
+ }
+ if (!match) failed = true;
+
+ // check frequency
+ match = false;
+ if (!failed) {
+ for( int i = 0; i < freqz.count(); i++) {
+ if (format.frequency() == freqz.at(i)) {
+ match = true;
+ break;
+ }
+ }
+ }
- if(!failed && !(format.channels() == 1 || format.channels() == 2))
- failed = true;
+ // check sample size
+ match = false;
+ if (!failed) {
+ for( int i = 0; i < sizez.count(); i++) {
+ if (format.sampleSize() == sizez.at(i)) {
+ match = true;
+ break;
+ }
+ }
+ }
- if(!failed) {
- if(!(format.frequency() == 8000 || format.frequency() == 11025 || format.frequency() == 22050 ||
- format.frequency() == 44100 || format.frequency() == 48000 || format.frequency() == 96000))
- failed = true;
+ // check byte order
+ match = false;
+ if (!failed) {
+ for( int i = 0; i < byteOrderz.count(); i++) {
+ if (format.byteOrder() == byteOrderz.at(i)) {
+ match = true;
+ break;
+ }
+ }
}
- if(!failed && !(format.sampleSize() == 8 || format.sampleSize() == 16))
- failed = true;
+ // check sample type
+ match = false;
+ if (!failed) {
+ for( int i = 0; i < typez.count(); i++) {
+ if (format.sampleType() == typez.at(i)) {
+ match = true;
+ break;
+ }
+ }
+ }
if(!failed) {
// settings work
@@ -332,6 +382,8 @@ void QAudioDeviceInfoInternal::updateLists()
codecz.append(QLatin1String("audio/pcm"));
}
+ if (freqz.count() > 0)
+ freqz.prepend(8000);
}
QList<QByteArray> QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode)
diff --git a/src/multimedia/audio/qaudioinput_alsa_p.cpp b/src/multimedia/audio/qaudioinput_alsa_p.cpp
index ead9995..6b15008 100644
--- a/src/multimedia/audio/qaudioinput_alsa_p.cpp
+++ b/src/multimedia/audio/qaudioinput_alsa_p.cpp
@@ -428,7 +428,6 @@ bool QAudioInputPrivate::open()
void QAudioInputPrivate::close()
{
- deviceState = QAudio::StoppedState;
timer->stop();
if ( handle ) {
diff --git a/src/multimedia/audio/qaudioinput_win32_p.cpp b/src/multimedia/audio/qaudioinput_win32_p.cpp
index 180cbda..b5d673e 100644
--- a/src/multimedia/audio/qaudioinput_win32_p.cpp
+++ b/src/multimedia/audio/qaudioinput_win32_p.cpp
@@ -57,8 +57,6 @@ QT_BEGIN_NAMESPACE
//#define DEBUG_AUDIO 1
-static CRITICAL_SECTION waveInCriticalSection;
-
static const int minimumIntervalTime = 50;
QAudioInputPrivate::QAudioInputPrivate(const QByteArray &device, const QAudioFormat& audioFormat):
@@ -104,16 +102,16 @@ void QT_WIN_CALLBACK QAudioInputPrivate::waveInProc( HWAVEIN hWaveIn, UINT uMsg,
case WIM_OPEN:
break;
case WIM_DATA:
- EnterCriticalSection(&waveInCriticalSection);
+ EnterCriticalSection(&qAudio->waveInCriticalSection);
if(qAudio->waveFreeBlockCount > 0)
qAudio->waveFreeBlockCount--;
qAudio->feedback();
- LeaveCriticalSection(&waveInCriticalSection);
+ LeaveCriticalSection(&qAudio->waveInCriticalSection);
break;
case WIM_CLOSE:
- EnterCriticalSection(&waveInCriticalSection);
+ EnterCriticalSection(&qAudio->waveInCriticalSection);
qAudio->finished = true;
- LeaveCriticalSection(&waveInCriticalSection);
+ LeaveCriticalSection(&qAudio->waveInCriticalSection);
break;
default:
return;
@@ -226,8 +224,8 @@ bool QAudioInputPrivate::open()
#endif
header = 0;
if(buffer_size == 0) {
- // Default buffer size, 100ms, default period size is 20ms
- buffer_size = settings.frequency()*settings.channels()*(settings.sampleSize()/8)*0.1;
+ // Default buffer size, 200ms, default period size is 40ms
+ buffer_size = settings.frequency()*settings.channels()*(settings.sampleSize()/8)*0.2;
period_size = buffer_size/5;
} else {
period_size = buffer_size/5;
diff --git a/src/multimedia/audio/qaudioinput_win32_p.h b/src/multimedia/audio/qaudioinput_win32_p.h
index a2cf2ea..66c2535 100644
--- a/src/multimedia/audio/qaudioinput_win32_p.h
+++ b/src/multimedia/audio/qaudioinput_win32_p.h
@@ -122,6 +122,7 @@ private:
volatile int waveFreeBlockCount;
int waveCurrentBlock;
+ CRITICAL_SECTION waveInCriticalSection;
static void QT_WIN_CALLBACK waveInProc( HWAVEIN hWaveIn, UINT uMsg,
DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 );
diff --git a/src/multimedia/audio/qaudiooutput_alsa_p.cpp b/src/multimedia/audio/qaudiooutput_alsa_p.cpp
index 1cef335..cf3726b 100644
--- a/src/multimedia/audio/qaudiooutput_alsa_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_alsa_p.cpp
@@ -485,7 +485,6 @@ bool QAudioOutputPrivate::open()
void QAudioOutputPrivate::close()
{
- deviceState = QAudio::StoppedState;
timer->stop();
if ( handle ) {
@@ -701,6 +700,7 @@ bool QAudioOutputPrivate::deviceReady()
} else if(l < 0) {
close();
+ deviceState = QAudio::StoppedState;
errorState = QAudio::IOError;
emit stateChanged(deviceState);
}
diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp
index 4bcbd09..13bce58 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp
@@ -56,8 +56,6 @@
QT_BEGIN_NAMESPACE
-static CRITICAL_SECTION waveOutCriticalSection;
-
static const int minimumIntervalTime = 50;
QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, const QAudioFormat& audioFormat):
@@ -107,16 +105,16 @@ void CALLBACK QAudioOutputPrivate::waveOutProc( HWAVEOUT hWaveOut, UINT uMsg,
case WOM_CLOSE:
return;
case WOM_DONE:
- EnterCriticalSection(&waveOutCriticalSection);
+ EnterCriticalSection(&qAudio->waveOutCriticalSection);
if(qAudio->finished || qAudio->buffer_size == 0 || qAudio->period_size == 0) {
- LeaveCriticalSection(&waveOutCriticalSection);
+ LeaveCriticalSection(&qAudio->waveOutCriticalSection);
return;
}
qAudio->waveFreeBlockCount++;
if(qAudio->waveFreeBlockCount >= qAudio->buffer_size/qAudio->period_size)
qAudio->waveFreeBlockCount = qAudio->buffer_size/qAudio->period_size;
qAudio->feedback();
- LeaveCriticalSection(&waveOutCriticalSection);
+ LeaveCriticalSection(&qAudio->waveOutCriticalSection);
break;
default:
return;
diff --git a/src/multimedia/audio/qaudiooutput_win32_p.h b/src/multimedia/audio/qaudiooutput_win32_p.h
index bb176a0..68a40f7 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.h
+++ b/src/multimedia/audio/qaudiooutput_win32_p.h
@@ -119,6 +119,8 @@ private:
static void QT_WIN_CALLBACK waveOutProc( HWAVEOUT hWaveOut, UINT uMsg,
DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 );
+ CRITICAL_SECTION waveOutCriticalSection;
+
WAVEHDR* allocateBlocks(int size, int count);
void freeBlocks(WAVEHDR* blockArray);
bool open();
diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp
index ec6817a..cce6bd9 100644
--- a/src/network/access/qnetworkdiskcache.cpp
+++ b/src/network/access/qnetworkdiskcache.cpp
@@ -41,7 +41,6 @@
//#define QNETWORKDISKCACHE_DEBUG
-#ifndef QT_NO_NETWORKDISKCACHE
#include "qnetworkdiskcache.h"
#include "qnetworkdiskcache_p.h"
@@ -60,6 +59,8 @@
#define CACHE_POSTFIX QLatin1String(".cache")
#define MAX_COMPRESSION_SIZE (1024 * 1024 * 3)
+#ifndef QT_NO_NETWORKDISKCACHE
+
QT_BEGIN_NAMESPACE
/*!
diff --git a/src/network/access/qnetworkdiskcache_p.h b/src/network/access/qnetworkdiskcache_p.h
index ad46602..b6df179 100644
--- a/src/network/access/qnetworkdiskcache_p.h
+++ b/src/network/access/qnetworkdiskcache_p.h
@@ -59,6 +59,8 @@
#include <qhash.h>
#include <qtemporaryfile.h>
+#ifndef QT_NO_NETWORKDISKCACHE
+
QT_BEGIN_NAMESPACE
class QFile;
@@ -119,4 +121,6 @@ public:
QT_END_NAMESPACE
+#endif // QT_NO_NETWORKDISKCACHE
+
#endif // QNETWORKDISKCACHE_P_H
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
index 55fd922..83b4b21 100644
--- a/src/opengl/qglshaderprogram.cpp
+++ b/src/opengl/qglshaderprogram.cpp
@@ -999,17 +999,18 @@ GLuint QGLShaderProgram::programId() const
Any attributes that have not been explicitly bound when the program
is linked will be assigned locations automatically.
+ When this function is called after the program has been linked,
+ the program will need to be relinked for the change to take effect.
+
\sa attributeLocation()
*/
void QGLShaderProgram::bindAttributeLocation(const char *name, int location)
{
Q_D(QGLShaderProgram);
- if (!d->linked) {
- glBindAttribLocation(d->programGuard.id(), location, name);
- } else {
- qWarning() << "QGLShaderProgram::bindAttributeLocation(" << name
- << "): cannot bind after shader program is linked";
- }
+ if (!init())
+ return;
+ glBindAttribLocation(d->programGuard.id(), location, name);
+ d->linked = false; // Program needs to be relinked.
}
/*!
@@ -1020,6 +1021,9 @@ void QGLShaderProgram::bindAttributeLocation(const char *name, int location)
Any attributes that have not been explicitly bound when the program
is linked will be assigned locations automatically.
+ When this function is called after the program has been linked,
+ the program will need to be relinked for the change to take effect.
+
\sa attributeLocation()
*/
void QGLShaderProgram::bindAttributeLocation(const QByteArray& name, int location)
@@ -1035,6 +1039,9 @@ void QGLShaderProgram::bindAttributeLocation(const QByteArray& name, int locatio
Any attributes that have not been explicitly bound when the program
is linked will be assigned locations automatically.
+ When this function is called after the program has been linked,
+ the program will need to be relinked for the change to take effect.
+
\sa attributeLocation()
*/
void QGLShaderProgram::bindAttributeLocation(const QString& name, int location)