1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 20:22:30 +01:00

cellAudio: weak_ptr -> shared_ptr

This commit is contained in:
Eladash 2021-05-14 15:18:30 +03:00 committed by Ivan
parent 94e2f464e3
commit a992a5fba9
2 changed files with 5 additions and 7 deletions

View File

@ -505,7 +505,7 @@ void cell_audio_thread::advance(u64 timestamp, bool reset)
continue;
}
if ((queues[queue_count] = key_inf.port.lock()))
if ((queues[queue_count] = key_inf.port))
{
u32 periods = 1;
@ -1570,14 +1570,12 @@ error_code AudioSetNotifyEventQueue(u64 key, u32 iFlags)
for (auto i = g_audio.keys.cbegin(); i != g_audio.keys.cend();) // check for duplicates
{
auto port = i->port.lock();
if (port == q)
if (i->port == q)
{
return CELL_AUDIO_ERROR_TRANS_EVENT;
}
if (!lv2_event_queue::check(port))
if (!lv2_event_queue::check(i->port))
{
// Cleanup, avoid cases where there are multiple ports with the same key
i = g_audio.keys.erase(i);
@ -1627,7 +1625,7 @@ error_code AudioRemoveNotifyEventQueue(u64 key, u32 iFlags)
for (auto i = g_audio.keys.cbegin(); i != g_audio.keys.cend(); i++)
{
if ([&](auto port){ return lv2_event_queue::check(port) && port->key == key; }(i->port.lock()))
if (lv2_event_queue::check(i->port) && i->port->key == key)
{
if (i->flags != iFlags)
{

View File

@ -383,7 +383,7 @@ public:
u8 start_period; // Starting event_period
u32 flags; // iFlags
u64 source; // Event source
std::weak_ptr<lv2_event_queue> port; // Underlying event port
std::shared_ptr<lv2_event_queue> port; // Underlying event port
};
std::vector<key_info> keys;