mfplay: Fix output argument handling in CreateMediaItemFromURL().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
848f2a4be0
commit
4f92399660
|
@ -968,8 +968,6 @@ static HRESULT media_player_create_item_from_url(struct media_player *player,
|
|||
IUnknown *object;
|
||||
HRESULT hr;
|
||||
|
||||
*ret = NULL;
|
||||
|
||||
if (FAILED(hr = create_media_item(&player->IMFPMediaPlayer_iface, user_data, &item)))
|
||||
return hr;
|
||||
|
||||
|
@ -981,6 +979,11 @@ static HRESULT media_player_create_item_from_url(struct media_player *player,
|
|||
|
||||
if (sync)
|
||||
{
|
||||
if (!ret)
|
||||
return E_POINTER;
|
||||
|
||||
*ret = NULL;
|
||||
|
||||
if (SUCCEEDED(hr = IMFSourceResolver_CreateObjectFromURL(player->resolver, url, MF_RESOLUTION_MEDIASOURCE,
|
||||
player->propstore, &obj_type, &object)))
|
||||
{
|
||||
|
@ -1000,6 +1003,14 @@ static HRESULT media_player_create_item_from_url(struct media_player *player,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!player->callback)
|
||||
{
|
||||
WARN("Asynchronous item creation is not supported without user callback.\n");
|
||||
return MF_E_INVALIDREQUEST;
|
||||
}
|
||||
|
||||
if (ret) *ret = NULL;
|
||||
|
||||
hr = IMFSourceResolver_BeginCreateObjectFromURL(player->resolver, url, MF_RESOLUTION_MEDIASOURCE,
|
||||
player->propstore, NULL, &player->resolver_callback, (IUnknown *)&item->IMFPMediaItem_iface);
|
||||
|
||||
|
|
|
@ -226,6 +226,7 @@ todo_wine
|
|||
static void test_media_item(void)
|
||||
{
|
||||
IMFPMediaPlayer *player;
|
||||
IMFPMediaItem *item;
|
||||
HRESULT hr;
|
||||
|
||||
hr = MFPCreateMediaPlayer(NULL, FALSE, 0, NULL, NULL, &player);
|
||||
|
@ -234,6 +235,16 @@ static void test_media_item(void)
|
|||
hr = IMFPMediaPlayer_SetMediaItem(player, NULL);
|
||||
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
|
||||
|
||||
/* Async mode, no callback was specified. */
|
||||
hr = IMFPMediaPlayer_CreateMediaItemFromURL(player, L"url", FALSE, 0, &item);
|
||||
ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IMFPMediaPlayer_CreateMediaItemFromURL(player, L"url", FALSE, 0, NULL);
|
||||
ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IMFPMediaPlayer_CreateMediaItemFromURL(player, L"url", TRUE, 0, NULL);
|
||||
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
|
||||
|
||||
IMFPMediaPlayer_Release(player);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue