summaryrefslogtreecommitdiffstats
path: root/src/plugins/winrt/qwinrtmediaplayercontrol.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/winrt/qwinrtmediaplayercontrol.cpp')
-rw-r--r--src/plugins/winrt/qwinrtmediaplayercontrol.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/winrt/qwinrtmediaplayercontrol.cpp b/src/plugins/winrt/qwinrtmediaplayercontrol.cpp
index 8954d4445..d00788e64 100644
--- a/src/plugins/winrt/qwinrtmediaplayercontrol.cpp
+++ b/src/plugins/winrt/qwinrtmediaplayercontrol.cpp
@@ -51,7 +51,6 @@
#include <mfapi.h>
#include <mfmediaengine.h>
-#include <comdef.h>
#include <wrl.h>
using namespace Microsoft::WRL;
@@ -389,8 +388,13 @@ public:
HRESULT __stdcall SetCurrentPosition(QWORD position)
{
qint64 pos(position);
- if (pos >= d->stream->size())
- return E_INVALIDARG;
+ if (pos >= d->stream->size()) {
+ // MSDN states we should return E_INVALIDARG, but that immediately
+ // stops playback and does not play remaining buffers in the queue.
+ // For some formats this can cause losing up to 5 seconds of the
+ // end of the stream.
+ return S_FALSE;
+ }
const bool ok = d->stream->seek(pos);
return ok ? S_OK : S_FALSE;