From 13a53a505640aebd2b10c0c52977650c797678ad Mon Sep 17 00:00:00 2001 From: Bernd Weimer Date: Tue, 27 Aug 2013 10:39:31 +0200 Subject: BlackBerry: Pass encoded URLs to mm renderer MM renderer expects (remote) URLs to be percent encoded. Change-Id: Ib7429cbeb3b7aa6baba99419d8b101a712ab4881 Reviewed-by: Rafael Roquetto Reviewed-by: Thomas McGuire --- .../mediaplayer/bbmediaplayercontrol.cpp | 22 +++++++++++----------- .../blackberry/mediaplayer/bbmediaplayercontrol.h | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp b/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp index 1ef68cb12..c7a0fdd02 100644 --- a/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp +++ b/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp @@ -137,7 +137,7 @@ void BbMediaPlayerControl::closeConnection() } } -QString BbMediaPlayerControl::resourcePathForUrl(const QUrl &url) +QByteArray BbMediaPlayerControl::resourcePathForUrl(const QUrl &url) { // If this is a local file, mmrenderer expects the file:// prefix and an absolute path. // We treat URLs without scheme as local files, most likely someone just forgot to set the @@ -149,7 +149,7 @@ QString BbMediaPlayerControl::resourcePathForUrl(const QUrl &url) else relativeFilePath = url.path(); const QFileInfo fileInfo(relativeFilePath); - return QStringLiteral("file://") + fileInfo.absoluteFilePath(); + return QFile::encodeName(QStringLiteral("file://") + fileInfo.absoluteFilePath()); // QRC, copy to temporary file, as mmrenderer does not support resource files } else if (url.scheme() == QStringLiteral("qrc")) { @@ -159,17 +159,17 @@ QString BbMediaPlayerControl::resourcePathForUrl(const QUrl &url) QUuid::createUuid().toString() + QStringLiteral(".") + resourceFileInfo.suffix(); if (!QFile::copy(qrcPath, m_tempMediaFileName)) { - const QString errorMsg = - QString("Failed to copy resource file to temporary file %1 for playback").arg(m_tempMediaFileName); + const QString errorMsg = QString("Failed to copy resource file to temporary file " + "%1 for playback").arg(m_tempMediaFileName); qDebug() << errorMsg; emit error(0, errorMsg); - return QString(); + return QByteArray(); } - return m_tempMediaFileName; + return QFile::encodeName(m_tempMediaFileName); - // HTTP or similar URL, use as-is + // HTTP or similar URL } else { - return url.toString(); + return url.toEncoded(); } } @@ -195,14 +195,14 @@ void BbMediaPlayerControl::attach() return; } - const QString resourcePath = resourcePathForUrl(m_media.canonicalUrl()); + const QByteArray resourcePath = resourcePathForUrl(m_media.canonicalUrl()); if (resourcePath.isEmpty()) { detach(); return; } - if (mmr_input_attach(m_context, QFile::encodeName(resourcePath), "track") != 0) { - emitMmError(QString("mmr_input_attach() for %1 failed").arg(resourcePath)); + if (mmr_input_attach(m_context, resourcePath.constData(), "track") != 0) { + emitMmError(QStringLiteral("mmr_input_attach() failed for ") + QString(resourcePath)); setMediaStatus(QMediaPlayer::InvalidMedia); detach(); return; diff --git a/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.h b/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.h index a8a4a929c..16505fd5e 100644 --- a/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.h +++ b/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.h @@ -109,7 +109,7 @@ private Q_SLOTS: void continueLoadMedia(); private: - QString resourcePathForUrl(const QUrl &url); + QByteArray resourcePathForUrl(const QUrl &url); void openConnection(); void closeConnection(); void attach(); -- cgit v1.2.3 From 4715ec52b17a220c48a380a2cd1619ad5fb069a7 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 24 Aug 2013 20:51:24 +0100 Subject: Fix QAudioOutput::setVolume() limited 50% on 32-bit Windows A signed 16 bit integer was being used to pack a normalised double into half of a DWORD. It needed to be unsigned 16-bit to get the full range of the Windows volume control. Task-number: QTBUG-33160 Change-Id: Ic17f572a188401ee686c6e6af3984d52328ccda6 Reviewed-by: Alex Blasche Reviewed-by: Yoann Lopes --- src/multimedia/audio/qaudiooutput_win32_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp index 4d13d4349..286cecba7 100644 --- a/src/multimedia/audio/qaudiooutput_win32_p.cpp +++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp @@ -702,7 +702,7 @@ void QAudioOutputPrivate::setVolume(qreal v) volumeCache = normalizedVolume; return; } - const qint16 scaled = normalizedVolume * 0xFFFF; + const quint16 scaled = normalizedVolume * 0xFFFF; DWORD vol = MAKELONG(scaled, scaled); MMRESULT res = waveOutSetVolume(hWaveOut, vol); if (res == MMSYSERR_NOERROR) -- cgit v1.2.3