From fd3efc0163d9963c91e24ece43b774c70ec57640 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 27 Nov 2013 16:05:19 +0100 Subject: [PATCH 1/9] Android: print a warning when using SurfaceTexture on Android 2.3. SurfaceTexture is available since Android 3.0, print a warning when camera preview or video playback is used on an older Android version. Task-number: QTBUG-35075 Change-Id: Ie04c62df99048a25e8fd971e0708157d0d32c503 Reviewed-by: Christian Stromme Reviewed-by: Lars Knoll --- .../android/src/wrappers/jsurfacetexture.cpp | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/plugins/android/src/wrappers/jsurfacetexture.cpp b/src/plugins/android/src/wrappers/jsurfacetexture.cpp index 1505443a..47487f10 100644 --- a/src/plugins/android/src/wrappers/jsurfacetexture.cpp +++ b/src/plugins/android/src/wrappers/jsurfacetexture.cpp @@ -62,6 +62,8 @@ JSurfaceTexture::JSurfaceTexture(unsigned int texName) { if (isValid()) g_objectMap.insert(int(texName), this); + else // If the class is not available, it means the Android version is < 3.0 + qWarning("Camera preview and video playback require Android 3.0 (API level 11) or later."); } JSurfaceTexture::~JSurfaceTexture() @@ -94,16 +96,24 @@ static JNINativeMethod methods[] = { bool JSurfaceTexture::initJNI(JNIEnv *env) { - jclass clazz = env->FindClass("org/qtproject/qt5/android/multimedia/QtSurfaceTexture"); + // SurfaceTexture is available since API 11, try to find it first before loading + // our custom class + jclass surfaceTextureClass = env->FindClass("android/graphics/SurfaceTexture"); if (env->ExceptionCheck()) env->ExceptionClear(); - if (clazz) { - g_qtSurfaceTextureClass = static_cast(env->NewGlobalRef(clazz)); - if (env->RegisterNatives(g_qtSurfaceTextureClass, - methods, - sizeof(methods) / sizeof(methods[0])) < 0) { - return false; + if (surfaceTextureClass) { + jclass clazz = env->FindClass("org/qtproject/qt5/android/multimedia/QtSurfaceTexture"); + if (env->ExceptionCheck()) + env->ExceptionClear(); + + if (clazz) { + g_qtSurfaceTextureClass = static_cast(env->NewGlobalRef(clazz)); + if (env->RegisterNatives(g_qtSurfaceTextureClass, + methods, + sizeof(methods) / sizeof(methods[0])) < 0) { + return false; + } } } From e4654ca5ee255598269c0805507384c4a02ebdb2 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 27 Nov 2013 18:01:56 +0100 Subject: [PATCH 2/9] Fix version availability for VideoOutput's autoOrientation property. This new property is available since 5.2, not 5.1. Change-Id: Ie3b5cd3c5d909f6d4ba662a2eaf03f1e6bb8b21b Reviewed-by: Tobias Koenig Reviewed-by: Lars Knoll Reviewed-by: Thomas McGuire --- src/imports/multimedia/multimedia.cpp | 2 +- src/imports/multimedia/qdeclarativevideooutput.cpp | 2 +- src/imports/multimedia/qdeclarativevideooutput_p.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/imports/multimedia/multimedia.cpp b/src/imports/multimedia/multimedia.cpp index d2bc829d..f05252f5 100644 --- a/src/imports/multimedia/multimedia.cpp +++ b/src/imports/multimedia/multimedia.cpp @@ -76,7 +76,7 @@ public: qmlRegisterType(uri, 5, 0, "Audio"); qmlRegisterType(uri, 5, 0, "MediaPlayer"); qmlRegisterType(uri, 5, 0, "VideoOutput"); - qmlRegisterType(uri, 5, 1, "VideoOutput"); + qmlRegisterType(uri, 5, 2, "VideoOutput"); qmlRegisterType(uri, 5, 0, "Radio"); qmlRegisterType(uri, 5, 0, "RadioData"); qmlRegisterType(uri, 5, 0, "Camera"); diff --git a/src/imports/multimedia/qdeclarativevideooutput.cpp b/src/imports/multimedia/qdeclarativevideooutput.cpp index 07c78b79..240dc469 100644 --- a/src/imports/multimedia/qdeclarativevideooutput.cpp +++ b/src/imports/multimedia/qdeclarativevideooutput.cpp @@ -429,7 +429,7 @@ void QDeclarativeVideoOutput::setOrientation(int orientation) By default \c autoOrientation is disabled. - \since QtMultimedia 5.1 + \since QtMultimedia 5.2 */ bool QDeclarativeVideoOutput::autoOrientation() const { diff --git a/src/imports/multimedia/qdeclarativevideooutput_p.h b/src/imports/multimedia/qdeclarativevideooutput_p.h index 1de1fccb..07fdb41e 100644 --- a/src/imports/multimedia/qdeclarativevideooutput_p.h +++ b/src/imports/multimedia/qdeclarativevideooutput_p.h @@ -62,7 +62,7 @@ class QDeclarativeVideoOutput : public QQuickItem Q_PROPERTY(QObject* source READ source WRITE setSource NOTIFY sourceChanged) Q_PROPERTY(FillMode fillMode READ fillMode WRITE setFillMode NOTIFY fillModeChanged) Q_PROPERTY(int orientation READ orientation WRITE setOrientation NOTIFY orientationChanged) - Q_PROPERTY(bool autoOrientation READ autoOrientation WRITE setAutoOrientation NOTIFY autoOrientationChanged REVISION 1) + Q_PROPERTY(bool autoOrientation READ autoOrientation WRITE setAutoOrientation NOTIFY autoOrientationChanged REVISION 2) Q_PROPERTY(QRectF sourceRect READ sourceRect NOTIFY sourceRectChanged) Q_PROPERTY(QRectF contentRect READ contentRect NOTIFY contentRectChanged) Q_ENUMS(FillMode) From 288e49d49308f84afa180086aebb9ce61738e626 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 27 Nov 2013 19:20:27 +0100 Subject: [PATCH 3/9] Add changes-5.2.0 file. Change-Id: Ieec89755a30996a5b0ed37ecaa6ee957344f8594 Reviewed-by: Sergio Ahumada Reviewed-by: Lars Knoll --- dist/changes-5.2.0 | 86 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 dist/changes-5.2.0 diff --git a/dist/changes-5.2.0 b/dist/changes-5.2.0 new file mode 100644 index 00000000..e4856595 --- /dev/null +++ b/dist/changes-5.2.0 @@ -0,0 +1,86 @@ +Qt 5.2 introduces many new features and improvements as well as bugfixes +over the 5.1.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + + http://qt-project.org/doc/qt-5.2 + +The Qt version 5.2 series is binary compatible with the 5.1.x series. +Applications compiled for 5.1 will continue to run with 5.2. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + http://bugreports.qt-project.org/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* General * +**************************************************************************** + + - Improved ALSA implementation of the audio APIs. + - Improved WAV support in QSoundEffect. + - New resource policy plugin based on libresourceqt. + - Fix QVideoSurfaceArbFpPainter mistakenly failing to start in some cases. + - Improved QAudioRecorder implementation on Windows and Mac OS. + - Various documentation fixes. + - Improved audiorecorder example. + - [QTBUG-32487] Make PulseAudio implementation of QSoundEffect more robust. + - [QTBUG-32882] Enable QSoundEffect with loopCount of Infinite to play. + - [QTBUG-31731] WMF and GStreamer: fixed incorrect frame startTime and endTime. + - [QTBUG-30442] VideoOutput: take the video format's scanLineDirection into account. + - [QTBUG-34125] Correctly clear the current media in Audio and MediaPlayer qml elements. + +Qt for Android +-------------- + + - New OpenSL ES plugin for low-latency audio support on Android. + - New camera support on Android. + - Improved video renderering with Qt Quick. + - Camera and recording permissions are now automatically added when using QtMultimedia on Android. + - [QTBUG-32635] Fixed media player buffering logic. + - [QTBUG-34558] Fix two race conditions in the media player. + +Qt for iOS +---------- + + - New media player and basic camera support on iOS. + +Qt for BlackBerry +----------------- + + - Fix setting a URL containing reserved characters on a media player. + - Enable camera on the Playbook. + - New QAudioRecorder support. + - Fix video recording with BB 10.2. + - Improve camera focus handling. + - Fixed pixel aspect ratio for video windows. + - [QTBUG-33739] Fix camera viewfinder. + +Qt for Windows +-------------- + + - WMF: emit positionChanged() signal when reaching the end of a media. + - [QTBUG-30776] DirectShow: improve metadata support. + - [QTBUG-33631][QTBUG-33518] WMF: allow to load media whose content doesn't match its file extension. + - [QTBUG-33518] WMF: allow to load QRC files with QAudioDecoder. + - [QTBUG-30435] WMF: fixed the media player failing to play some media formats. + - [QTBUG-32360] WMF: fixed compilation with Visual Studio 2008. + - [QTBUG-34479] DirectShow: fixed compilation with Visual Studio 2008. + - [QTBUG-32864] WMF: fixed compilation on Windows Vista. + - [QTBUG-30825] WMF: fixed QMediaPlayer changing to EndOfMedia status too early. + - [QTBUG-33160] Fix QAudioOutput::setVolume() limited to 50% on 32-bit Windows. + +Qt for QNX +---------- + + - New camera and media player support when mmrenderer is available. + +**************************************************************************** +* Plugins * +**************************************************************************** + + - New QML import version QtMultimedia 5.2 adds a new autoOrientation + property to the VideoOutput type, which allows the video output to + always match the screen orientation. From ea9f9788d502d4a4307a464d87a00be198df09ad Mon Sep 17 00:00:00 2001 From: Frank Osterfeld Date: Thu, 28 Nov 2013 10:27:46 +0100 Subject: [PATCH 4/9] QNX/PPS: Fix end-of-track handling The state to check for is actually "stopped", not "STOPPED". Fixes end-of-track detection. Task-number: QTBUG-35189 Change-Id: Ifa2f0635b31ef8c584c1800ef870c0dbef2b1daf Reviewed-by: Thomas McGuire Reviewed-by: Tobias Koenig Reviewed-by: Rafael Roquetto --- src/plugins/qnx/mediaplayer/ppsmediaplayercontrol.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qnx/mediaplayer/ppsmediaplayercontrol.cpp b/src/plugins/qnx/mediaplayer/ppsmediaplayercontrol.cpp index eb0842fb..b54c7963 100644 --- a/src/plugins/qnx/mediaplayer/ppsmediaplayercontrol.cpp +++ b/src/plugins/qnx/mediaplayer/ppsmediaplayercontrol.cpp @@ -57,7 +57,7 @@ PpsMediaPlayerControl::PpsMediaPlayerControl(QObject *parent) m_ppsStatusFd(-1), m_ppsStateNotifier(0), m_ppsStateFd(-1) - , m_previouslySeenState("STOPPED") + , m_previouslySeenState("stopped") { openConnection(); } @@ -177,7 +177,7 @@ void PpsMediaPlayerControl::ppsReadyRead(int fd) if (pps_decoder_get_string(&decoder, "state", &value) == PPS_DECODER_OK) { const QByteArray state = value; - if (state != m_previouslySeenState && state == "STOPPED") + if (state != m_previouslySeenState && state == "stopped") handleMmStopped(); m_previouslySeenState = state; } From dd11f6d0527bfac17d855909397f66fe816a0d1f Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Tue, 26 Nov 2013 16:34:29 +0100 Subject: [PATCH 5/9] CoreAudio: fix supported input and output channel count. Only the maximum number of channels was reported as being supported. We now report all possible configurations up to the maximum number of channels to be supported. Task-number: QTBUG-34639 Change-Id: Ib4c599ea8b772ebeaaca95137d24bac49dbd80d3 Reviewed-by: Christian Stromme Reviewed-by: Ivan Romanov Reviewed-by: Andy Nichols --- src/plugins/coreaudio/coreaudiodeviceinfo.mm | 25 ++++++++++---------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/plugins/coreaudio/coreaudiodeviceinfo.mm b/src/plugins/coreaudio/coreaudiodeviceinfo.mm index 77a9b835..92ce9886 100644 --- a/src/plugins/coreaudio/coreaudiodeviceinfo.mm +++ b/src/plugins/coreaudio/coreaudiodeviceinfo.mm @@ -188,11 +188,11 @@ QList CoreAudioDeviceInfo::supportedSampleRates() QList CoreAudioDeviceInfo::supportedChannelCounts() { - QSet supportedChannels; + QList supportedChannels; + int maxChannels = 0; #if defined(Q_OS_OSX) UInt32 propSize = 0; - int channels = 0; AudioObjectPropertyScope scope = m_mode == QAudio::AudioInput ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput; AudioObjectPropertyAddress streamConfigurationPropertyAddress = { kAudioDevicePropertyStreamConfiguration, scope, @@ -203,24 +203,25 @@ QList CoreAudioDeviceInfo::supportedChannelCounts() if (audioBufferList != 0) { if (AudioObjectGetPropertyData(m_deviceId, &streamConfigurationPropertyAddress, 0, NULL, &propSize, audioBufferList) == noErr) { - for (int i = 0; i < int(audioBufferList->mNumberBuffers); ++i) { - channels += audioBufferList->mBuffers[i].mNumberChannels; - supportedChannels << channels; - } + for (int i = 0; i < int(audioBufferList->mNumberBuffers); ++i) + maxChannels += audioBufferList->mBuffers[i].mNumberChannels; } free(audioBufferList); } } #else //iOS - if (m_mode == QAudio::AudioInput) { - supportedChannels << CoreAudioSessionManager::instance().inputChannelCount(); - } else if (m_mode == QAudio::AudioOutput) { - supportedChannels << CoreAudioSessionManager::instance().outputChannelCount(); - } + if (m_mode == QAudio::AudioInput) + maxChannels = CoreAudioSessionManager::instance().inputChannelCount(); + else if (m_mode == QAudio::AudioOutput) + maxChannels = CoreAudioSessionManager::instance().outputChannelCount(); #endif - return supportedChannels.toList(); + // Assume all channel configurations are supported up to the maximum number of channels + for (int i = 1; i <= maxChannels; ++i) + supportedChannels.append(i); + + return supportedChannels; } From 14f31c29cf0bc78f66064306a91d3cb69677f542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Tue, 12 Nov 2013 04:01:28 +0100 Subject: [PATCH 6/9] OpenSL: Fix volume scale The old code was assuming that the interface was expecting power values, while it actually uses amplitude values. In addition the difference between the min/max values where used, resulting in quite high gain values. Task-number: QTBUG-34777 Change-Id: Ibd3f7774b67c44e37dfd79cbe6e2c35746f00a0a Reviewed-by: Yoann Lopes --- src/plugins/opensles/qopenslesaudiooutput.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/opensles/qopenslesaudiooutput.cpp b/src/plugins/opensles/qopenslesaudiooutput.cpp index 65c0f5a6..df91e6ff 100644 --- a/src/plugins/opensles/qopenslesaudiooutput.cpp +++ b/src/plugins/opensles/qopenslesaudiooutput.cpp @@ -52,6 +52,8 @@ #define BUFFER_COUNT 2 #define DEFAULT_PERIOD_TIME_MS 50 #define MINIMUM_PERIOD_TIME_MS 5 +#define EBASE 2.302585093 +#define LOG10(x) qLn(x)/qreal(EBASE) QT_BEGIN_NAMESPACE @@ -622,7 +624,7 @@ inline SLmillibel QOpenSLESAudioOutput::adjustVolume(qreal vol) if (qFuzzyCompare(vol, qreal(1.0))) return 0; - return SL_MILLIBEL_MIN + ((1 - (qLn(10 - (vol * 10)) / qLn(10))) * SL_MILLIBEL_MAX); + return 20 * LOG10(vol) * 100; // I.e., 20 * LOG10(SL_MILLIBEL_MAX * vol / SL_MILLIBEL_MAX) } QT_END_NAMESPACE From 186aca3ba72efa3ff175487c0077565b41016158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Mon, 2 Dec 2013 17:05:44 +0100 Subject: [PATCH 7/9] Android: Add missing 'L' prefix and ';' postfix in areaToRect() While it works just fine without the post-/prefix, they are suppose to be there... Change-Id: I99365d37c70c65ccf0713d6b2d8330030b265e8e Reviewed-by: Yoann Lopes --- src/plugins/android/src/wrappers/jcamera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/android/src/wrappers/jcamera.cpp b/src/plugins/android/src/wrappers/jcamera.cpp index fc9b1806..2d42ffbd 100644 --- a/src/plugins/android/src/wrappers/jcamera.cpp +++ b/src/plugins/android/src/wrappers/jcamera.cpp @@ -54,7 +54,7 @@ static QMap g_objectMap; static QRect areaToRect(jobject areaObj) { QJNIObjectPrivate area(areaObj); - QJNIObjectPrivate rect = area.getObjectField("rect", "android/graphics/Rect"); + QJNIObjectPrivate rect = area.getObjectField("rect", "Landroid/graphics/Rect;"); return QRect(rect.getField("left"), rect.getField("top"), From cbe9fc8e4db4efcf6a6b5e104af38bdf08f21984 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 4 Dec 2013 15:11:33 +0100 Subject: [PATCH 8/9] Revert "WMF: fixed MediaPlayer buffering logic." This reverts commit d599f7319af86265083bae96f21d942aeff24737. This was not the correct logic... According to the documentation, the BufferedMedia status should be set only when in the PlayingState. Change-Id: I36053ebc09c0517fcd2a1a7f2b091fbe8f04f3d0 Reviewed-by: Christian Stromme --- src/plugins/wmf/player/mfplayersession.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/plugins/wmf/player/mfplayersession.cpp b/src/plugins/wmf/player/mfplayersession.cpp index adc762d6..3c12bb04 100644 --- a/src/plugins/wmf/player/mfplayersession.cpp +++ b/src/plugins/wmf/player/mfplayersession.cpp @@ -1326,6 +1326,8 @@ void MFPlayerSession::start() switch (m_status) { case QMediaPlayer::EndOfMedia: m_varStart.hVal.QuadPart = 0; + //since it must be loaded already, just fallthrough + case QMediaPlayer::LoadedMedia: changeStatus(QMediaPlayer::BufferedMedia); return; } @@ -1920,12 +1922,10 @@ void MFPlayerSession::handleSessionEvent(IMFMediaEvent *sessionEvent) switch (meType) { case MEBufferingStarted: - changeStatus(m_status == QMediaPlayer::LoadedMedia ? QMediaPlayer::BufferingMedia : QMediaPlayer::StalledMedia); + changeStatus(QMediaPlayer::StalledMedia); emit bufferStatusChanged(bufferStatus()); break; case MEBufferingStopped: - if (m_status == QMediaPlayer::BufferingMedia) - stop(true); changeStatus(QMediaPlayer::BufferedMedia); emit bufferStatusChanged(bufferStatus()); break; @@ -1990,16 +1990,6 @@ void MFPlayerSession::handleSessionEvent(IMFMediaEvent *sessionEvent) } } MFGetService(m_session, MFNETSOURCE_STATISTICS_SERVICE, IID_PPV_ARGS(&m_netsourceStatistics)); - - if (!m_netsourceStatistics || bufferStatus() == 100) { - // If the source reader doesn't implement the statistics service, just set the status - // to buffered, since there is no way to query the buffering progress... - changeStatus(QMediaPlayer::BufferedMedia); - } else { - // Start to trigger buffering. Once enough buffering is done, the session will - // be automatically stopped unless the user has explicitly started playback. - start(); - } } } } From 99bebdbb7dbdde259bc06e86079daebb17482c64 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 4 Dec 2013 17:02:27 +0100 Subject: [PATCH 9/9] WMF: fixed various media player issues. - Switch to BufferedMedia only once playback actually started, not when requesting to start. - Report the position to have changed when seeking in stopped state. Change-Id: I930b3e6977cebe5935ed033d0a4d4e1eb899ad2c Reviewed-by: Christian Stromme --- src/plugins/wmf/player/mfplayersession.cpp | 31 +++++++++++++--------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/plugins/wmf/player/mfplayersession.cpp b/src/plugins/wmf/player/mfplayersession.cpp index 3c12bb04..8e0235e9 100644 --- a/src/plugins/wmf/player/mfplayersession.cpp +++ b/src/plugins/wmf/player/mfplayersession.cpp @@ -1323,14 +1323,8 @@ void MFPlayerSession::stop(bool immediate) void MFPlayerSession::start() { - switch (m_status) { - case QMediaPlayer::EndOfMedia: - m_varStart.hVal.QuadPart = 0; - //since it must be loaded already, just fallthrough - case QMediaPlayer::LoadedMedia: - changeStatus(QMediaPlayer::BufferedMedia); - return; - } + if (m_status == QMediaPlayer::EndOfMedia) + m_varStart.hVal.QuadPart = 0; // restart from the beginning #ifdef DEBUG_MEDIAFOUNDATION qDebug() << "start"; @@ -1464,6 +1458,9 @@ void MFPlayerSession::setPositionInternal(qint64 position, Command requestCmd) if (m_state.command == CmdStop && requestCmd != CmdSeekResume) { m_varStart.vt = VT_I8; m_varStart.hVal.QuadPart = LONGLONG(position * 10000); + // Even though the position is not actually set on the session yet, + // report it to have changed anyway for UI controls to be updated + emit positionChanged(this->position()); return; } @@ -1563,6 +1560,8 @@ void MFPlayerSession::commitRateChange(qreal rate, BOOL isThin) m_presentationClock->GetCorrelatedTime(0, &hnsClockTime, &hnsSystemTime); Q_ASSERT(hnsSystemTime != 0); + m_request.setCommand(rate < 0 || m_state.rate < 0 ? CmdSeekResume : CmdStart); + // We need to stop only when dealing with negative rates if (rate >= 0 && m_state.rate >= 0) pause(); @@ -1571,7 +1570,6 @@ void MFPlayerSession::commitRateChange(qreal rate, BOOL isThin) // If we deal with negative rates, we stopped the session and consequently // reset the position to zero. We then need to resume to the current position. - m_request.setCommand(rate < 0 || m_state.rate < 0 ? CmdSeekResume : CmdStart); m_request.start = hnsClockTime / 10000; } else if (cmdNow == CmdPause) { if (rate < 0 || m_state.rate < 0) { @@ -1606,10 +1604,11 @@ void MFPlayerSession::commitRateChange(qreal rate, BOOL isThin) // Changing rate from negative to zero requires to stop the session m_presentationClock->GetCorrelatedTime(0, &hnsClockTime, &hnsSystemTime); + m_request.setCommand(CmdSeekResume); + stop(); - // Resumte to the current position (stop() will reset the position to 0) - m_request.setCommand(CmdSeekResume); + // Resume to the current position (stop() will reset the position to 0) m_request.start = hnsClockTime / 10000; } @@ -1837,6 +1836,12 @@ void MFPlayerSession::handleSessionEvent(IMFMediaEvent *sessionEvent) updatePendingCommands(CmdStart); break; case MESessionStarted: + if (m_status == QMediaPlayer::EndOfMedia + || m_status == QMediaPlayer::LoadedMedia) { + // If the session started, then enough data is buffered to play + changeStatus(QMediaPlayer::BufferedMedia); + } + updatePendingCommands(CmdStart); #ifndef Q_WS_SIMULATOR // playback started, we can now set again the procAmpValues if they have been @@ -1852,8 +1857,8 @@ void MFPlayerSession::handleSessionEvent(IMFMediaEvent *sessionEvent) m_varStart.hVal.QuadPart = 0; // Reset to Loaded status unless we are loading a new media - // or if the media is buffered (to avoid restarting the video surface) - if (m_status != QMediaPlayer::LoadingMedia && m_status != QMediaPlayer::BufferedMedia) + // or changing the playback rate to negative values (stop required) + if (m_status != QMediaPlayer::LoadingMedia && m_request.command != CmdSeekResume) changeStatus(QMediaPlayer::LoadedMedia); } updatePendingCommands(CmdStop);