summaryrefslogtreecommitdiff
path: root/src/plugins/wmf
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-28 16:25:20 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-09-01 12:52:51 +0200
commit659f238bbbe040cce1bdf900f8f5500845ca8727 (patch)
tree7990072bf39b2c19df68bcd7615242d08eb8dd2f /src/plugins/wmf
parent80ba1d635dc37963b4c90d776c46774b0349c4f8 (diff)
parent1dba07b602ef8b3fd9333a8afb1db4cbaf9d824e (diff)
downloadqtmultimedia-659f238bbbe040cce1bdf900f8f5500845ca8727.tar.gz
Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts: src/gsttools/qgstreamervideoinputdevicecontrol.cpp src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp Change-Id: Ic854589562d2deeaa0ebf75840cb8a2ee32e99de
Diffstat (limited to 'src/plugins/wmf')
-rw-r--r--src/plugins/wmf/player/mfplayersession.cpp41
1 files changed, 26 insertions, 15 deletions
diff --git a/src/plugins/wmf/player/mfplayersession.cpp b/src/plugins/wmf/player/mfplayersession.cpp
index 77b19f1b0..4ddb82ee6 100644
--- a/src/plugins/wmf/player/mfplayersession.cpp
+++ b/src/plugins/wmf/player/mfplayersession.cpp
@@ -1395,14 +1395,17 @@ int MFPlayerSession::bufferStatus()
if (!m_netsourceStatistics)
return 0;
PROPVARIANT var;
+ PropVariantInit(&var);
PROPERTYKEY key;
key.fmtid = MFNETSOURCE_STATISTICS;
key.pid = MFNETSOURCE_BUFFERPROGRESS_ID;
int progress = -1;
- if (SUCCEEDED(m_netsourceStatistics->GetValue(key, &var))) {
+ // GetValue returns S_FALSE if the property is not available, which has
+ // a value > 0. We therefore can't use the SUCCEEDED macro here.
+ if (m_netsourceStatistics->GetValue(key, &var) == S_OK) {
progress = var.lVal;
+ PropVariantClear(&var);
}
- PropVariantClear(&var);
#ifdef DEBUG_MEDIAFOUNDATION
qDebug() << "bufferStatus: progress = " << progress;
@@ -1413,22 +1416,30 @@ int MFPlayerSession::bufferStatus()
QMediaTimeRange MFPlayerSession::availablePlaybackRanges()
{
- if (!m_netsourceStatistics)
- return QMediaTimeRange();
+ // defaults to the whole media
+ qint64 start = 0;
+ qint64 end = qint64(m_duration / 10000);
- qint64 start = 0, end = 0;
- PROPVARIANT var;
- PROPERTYKEY key;
- key.fmtid = MFNETSOURCE_STATISTICS;
- key.pid = MFNETSOURCE_SEEKRANGESTART_ID;
- if (SUCCEEDED(m_netsourceStatistics->GetValue(key, &var))) {
- start = qint64(var.uhVal.QuadPart / 10000);
- key.pid = MFNETSOURCE_SEEKRANGEEND_ID;
- if (SUCCEEDED(m_netsourceStatistics->GetValue(key, &var))) {
- end = qint64(var.uhVal.QuadPart / 10000);
+ if (m_netsourceStatistics) {
+ PROPVARIANT var;
+ PropVariantInit(&var);
+ PROPERTYKEY key;
+ key.fmtid = MFNETSOURCE_STATISTICS;
+ key.pid = MFNETSOURCE_SEEKRANGESTART_ID;
+ // GetValue returns S_FALSE if the property is not available, which has
+ // a value > 0. We therefore can't use the SUCCEEDED macro here.
+ if (m_netsourceStatistics->GetValue(key, &var) == S_OK) {
+ start = qint64(var.uhVal.QuadPart / 10000);
+ PropVariantClear(&var);
+ PropVariantInit(&var);
+ key.pid = MFNETSOURCE_SEEKRANGEEND_ID;
+ if (m_netsourceStatistics->GetValue(key, &var) == S_OK) {
+ end = qint64(var.uhVal.QuadPart / 10000);
+ PropVariantClear(&var);
+ }
}
}
- PropVariantClear(&var);
+
return QMediaTimeRange(start, end);
}