mfplay: Do not clear media item when playback ends.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2021-10-22 08:22:58 +03:00 committed by Alexandre Julliard
parent fdc2d415b0
commit c6c3d6f963
1 changed files with 1 additions and 16 deletions

View File

@ -1860,21 +1860,6 @@ static void media_player_create_forward_event(struct media_player *player, HRESU
LeaveCriticalSection(&player->cs);
}
static void media_player_create_playback_ended_event(struct media_player *player, HRESULT event_status,
struct media_event **event)
{
EnterCriticalSection(&player->cs);
if (SUCCEEDED(media_event_create(player, MFP_EVENT_TYPE_PLAYBACK_ENDED, event_status, player->item, event)))
{
if (player->item)
IMFPMediaItem_Release(player->item);
player->item = NULL;
}
LeaveCriticalSection(&player->cs);
}
static HRESULT WINAPI media_player_session_events_callback_Invoke(IMFAsyncCallback *iface,
IMFAsyncResult *result)
{
@ -1936,7 +1921,7 @@ static HRESULT WINAPI media_player_session_events_callback_Invoke(IMFAsyncCallba
if (SUCCEEDED(IMFMediaEvent_GetUINT32(session_event, &MF_EVENT_TOPOLOGY_STATUS, &status)) &&
status == MF_TOPOSTATUS_ENDED)
{
media_player_create_playback_ended_event(player, event_status, &event);
media_event_create(player, MFP_EVENT_TYPE_PLAYBACK_ENDED, event_status, player->item, &event);
}
break;