media_win32: catch WinRT exceptions for PlaybackStatus()

This commit is contained in:
Hyper 2024-12-09 03:30:31 +00:00
parent b6de286057
commit f694b0d219

View file

@ -68,5 +68,13 @@ bool os::media::detail::IsExternalMediaPlaying()
if (!playbackInfo)
return false;
return playbackInfo.PlaybackStatus() == GlobalSystemMediaTransportControlsSessionPlaybackStatus::Playing;
try
{
return playbackInfo.PlaybackStatus() == GlobalSystemMediaTransportControlsSessionPlaybackStatus::Playing;
}
catch (...)
{
printf("[*] Failed to retrieve GSMTC playback status: 0x%08X\n", to_hresult().value);
return false;
}
}