mfplay: Handle shutdown state on GetMediaItem().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2021-04-13 09:03:32 +03:00 committed by Alexandre Julliard
parent 58d0cb0de0
commit e2f74ce448
2 changed files with 3 additions and 2 deletions

View File

@ -998,7 +998,9 @@ static HRESULT WINAPI media_player_GetMediaItem(IMFPMediaPlayer *iface, IMFPMedi
return E_POINTER;
EnterCriticalSection(&player->cs);
if (!player->item)
if (player->state == MFP_MEDIAPLAYER_STATE_SHUTDOWN)
hr = MF_E_SHUTDOWN;
else if (!player->item)
hr = MF_E_NOT_FOUND;
else
{

View File

@ -163,7 +163,6 @@ static void test_shutdown(void)
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
hr = IMFPMediaPlayer_GetMediaItem(player, &item);
todo_wine
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
hr = IMFPMediaPlayer_GetVideoWindow(player, &window);