Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfreadwrite/Makefile.in | 2 +- dlls/mfreadwrite/main.c | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/dlls/mfreadwrite/Makefile.in b/dlls/mfreadwrite/Makefile.in index afefdb5cc6..edc7ebd07d 100644 --- a/dlls/mfreadwrite/Makefile.in +++ b/dlls/mfreadwrite/Makefile.in @@ -1,6 +1,6 @@ MODULE = mfreadwrite.dll IMPORTLIB = mfreadwrite -IMPORTS = mfuuid uuid +IMPORTS = mfuuid uuid mfplat
C_SRCS = \ main.c diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index 098100df91..bcf79a8fbd 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -254,9 +254,23 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri static HRESULT create_source_reader_from_stream(IMFByteStream *stream, IMFAttributes *attributes, REFIID riid, void **out) { - /* FIXME: resolve bytestream to media source */ + IMFSourceResolver *resolver; + MF_OBJECT_TYPE obj_type; + IMFMediaSource *source; + HRESULT hr; + + if (FAILED(hr = MFCreateSourceResolver(&resolver))) + return hr;
- return create_source_reader_from_source(NULL, attributes, riid, out); + hr = IMFSourceResolver_CreateObjectFromByteStream(resolver, stream, NULL, MF_RESOLUTION_MEDIASOURCE, NULL, + &obj_type, (IUnknown **)&source); + IMFSourceResolver_Release(resolver); + if (FAILED(hr)) + return hr; + + hr = create_source_reader_from_source(source, attributes, riid, out); + IMFMediaSource_Release(source); + return hr; }
static HRESULT WINAPI sink_writer_QueryInterface(IMFSinkWriter *iface, REFIID riid, void **out)