mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-03-30 07:01:49 +00:00
Dereference D-Bus connection even when media is playing
This commit is contained in:
parent
43da7d33f3
commit
809c4fcb93
1 changed files with 7 additions and 3 deletions
|
|
@ -176,14 +176,18 @@ bool os::media::IsExternalMediaPlaying()
|
|||
if (!dbusConnection)
|
||||
return false;
|
||||
|
||||
bool result = false;
|
||||
|
||||
std::vector<std::string> busNames = GetMediaPlayerBusNames(dbusConnection);
|
||||
for (const auto& bus : busNames)
|
||||
{
|
||||
if (IsMediaPlayerPlaying(dbusConnection, bus))
|
||||
return true;
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DestroyDBusConnection(dbusConnection);
|
||||
|
||||
return false;
|
||||
return result;
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue