Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfreadwrite/main.c | 18 +++++++++++++++--- include/mfidl.idl | 12 ++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index ef9e06e851..516b5928b1 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -359,9 +359,21 @@ static HRESULT WINAPI src_reader_SetCurrentMediaType(IMFSourceReader *iface, DWO
static HRESULT WINAPI src_reader_SetCurrentPosition(IMFSourceReader *iface, REFGUID format, REFPROPVARIANT position) { - srcreader *This = impl_from_IMFSourceReader(iface); - FIXME("%p, %s, %p\n", This, debugstr_guid(format), position); - return E_NOTIMPL; + struct source_reader *reader = impl_from_IMFSourceReader(iface); + DWORD flags; + HRESULT hr; + + TRACE("%p, %s, %p.\n", iface, debugstr_guid(format), position); + + /* FIXME: fail if we got pending samples. */ + + if (FAILED(hr = IMFMediaSource_GetCharacteristics(reader->source, &flags))) + return hr; + + if (!(flags & MFMEDIASOURCE_CAN_SEEK)) + return MF_E_INVALIDREQUEST; + + return IMFMediaSource_Start(reader->source, reader->descriptor, format, position); }
static HRESULT WINAPI src_reader_ReadSample(IMFSourceReader *iface, DWORD index, diff --git a/include/mfidl.idl b/include/mfidl.idl index 6a958a9e6a..944f8f95ba 100644 --- a/include/mfidl.idl +++ b/include/mfidl.idl @@ -425,6 +425,18 @@ cpp_quote("HRESULT WINAPI MFGetService(IUnknown *object, REFGUID service, REFIID cpp_quote("MFTIME WINAPI MFGetSystemTime(void);") cpp_quote("HRESULT WINAPI MFShutdownObject(IUnknown *object);")
+typedef enum _MFMEDIASOURCE_CHARACTERISTICS +{ + MFMEDIASOURCE_IS_LIVE = 0x1, + MFMEDIASOURCE_CAN_SEEK = 0x2, + MFMEDIASOURCE_CAN_PAUSE = 0x4, + MFMEDIASOURCE_HAS_SLOW_SEEK = 0x8, + MFMEDIASOURCE_HAS_MULTIPLE_PRESENTATIONS = 0x10, + MFMEDIASOURCE_CAN_SKIPFORWARD = 0x20, + MFMEDIASOURCE_CAN_SKIPBACKWARD = 0x40, + MFMEDIASOURCE_DOES_NOT_USE_NETWORK = 0x80, +} MFMEDIASOURCE_CHARACTERISTICS; + [ object, uuid(279a808d-aec7-40c8-9c6b-a6b492c78a66),