summaryrefslogtreecommitdiffstats
path: root/src/plugins/wmf/mftvideo.cpp
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2013-08-16 17:51:53 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-22 13:16:49 +0200
commita2f078f1088827ec2bc066aaee7ca3199c6cb4eb (patch)
treea83d8cdf2f16d2950442373360dd169eb62e750f /src/plugins/wmf/mftvideo.cpp
parentca769ba264f868ea2f41f2656f7126218b428ad4 (diff)
WMF and GStreamer: fixed incorrect frame startTime and endTime.
The QVideoFrame documentation explicitly says that the time is in microseconds, however the GStreamer backend was setting the time in milliseconds and the WMF backend in 100-nanosecond units. With WMF, the time was missing from the QVideoFrame when presenting it to the video surface. Task-number: QTBUG-31731 Change-Id: I0638d2abf8eed25b3a531db67c19a18703e5b630 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src/plugins/wmf/mftvideo.cpp')
-rw-r--r--src/plugins/wmf/mftvideo.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/wmf/mftvideo.cpp b/src/plugins/wmf/mftvideo.cpp
index acec88d6b..8e7ce0693 100644
--- a/src/plugins/wmf/mftvideo.cpp
+++ b/src/plugins/wmf/mftvideo.cpp
@@ -632,13 +632,14 @@ QVideoFrame MFTransform::makeVideoFrame()
// That is why we copy data from IMFMediaBuffer here.
frame = QVideoFrame(new QMemoryVideoBuffer(array, m_bytesPerLine), m_format.frameSize(), m_format.pixelFormat());
+ // WMF uses 100-nanosecond units, Qt uses microseconds
LONGLONG startTime = -1;
if (SUCCEEDED(m_sample->GetSampleTime(&startTime))) {
- frame.setStartTime(startTime);
+ frame.setStartTime(startTime * 0.1);
LONGLONG duration = -1;
if (SUCCEEDED(m_sample->GetSampleDuration(&duration)))
- frame.setEndTime(startTime + duration);
+ frame.setEndTime((startTime + duration) * 0.1);
}
} while (false);