mirror of
https://github.com/hedge-dev/UnleashedRecomp
synced 2026-06-01 01:40:13 -04:00
media_win32: catch WinRT exceptions for PlaybackStatus()
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user