Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplay/Makefile.in | 2 +- dlls/mfplay/player.c | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/dlls/mfplay/Makefile.in b/dlls/mfplay/Makefile.in index c353fa33cc1..8cd572bf638 100644 --- a/dlls/mfplay/Makefile.in +++ b/dlls/mfplay/Makefile.in @@ -1,6 +1,6 @@ MODULE = mfplay.dll IMPORTLIB = mfplay -IMPORTS = mfplat mf user32 uuid mfuuid +IMPORTS = mfplat mf ole32 user32 uuid mfuuid
EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native
diff --git a/dlls/mfplay/player.c b/dlls/mfplay/player.c index 9f20d6c1a2a..87a345e6968 100644 --- a/dlls/mfplay/player.c +++ b/dlls/mfplay/player.c @@ -24,6 +24,7 @@ #include "winbase.h" #include "mfapi.h" #include "mfplay.h" +#include "mferror.h"
#include "wine/debug.h" #include "wine/heap.h" @@ -55,6 +56,7 @@ struct media_item IMFMediaSource *source; IMFPresentationDescriptor *pd; DWORD_PTR user_data; + WCHAR *url; };
struct media_player @@ -308,6 +310,7 @@ static ULONG WINAPI media_item_Release(IMFPMediaItem *iface) IMFMediaSource_Release(item->source); if (item->pd) IMFPresentationDescriptor_Release(item->pd); + free(item->url); heap_free(item); }
@@ -329,9 +332,19 @@ static HRESULT WINAPI media_item_GetMediaPlayer(IMFPMediaItem *iface,
static HRESULT WINAPI media_item_GetURL(IMFPMediaItem *iface, LPWSTR *url) { - FIXME("%p, %p.\n", iface, url); + struct media_item *item = impl_from_IMFPMediaItem(iface);
- return E_NOTIMPL; + TRACE("%p, %p.\n", iface, url); + + if (!item->url) + return MF_E_NOT_FOUND; + + if (!(*url = CoTaskMemAlloc((wcslen(item->url) + 1) * sizeof(*item->url)))) + return E_OUTOFMEMORY; + + wcscpy(*url, item->url); + + return S_OK; }
static HRESULT WINAPI media_item_GetObject(IMFPMediaItem *iface, IUnknown **obj) @@ -769,6 +782,12 @@ static HRESULT WINAPI media_player_CreateMediaItemFromURL(IMFPMediaPlayer *iface if (FAILED(hr = create_media_item(iface, user_data, &item))) return hr;
+ if (url && !(item->url = wcsdup(url))) + { + IMFPMediaItem_Release(&item->IMFPMediaItem_iface); + return E_OUTOFMEMORY; + } + if (sync) { *ret = NULL;