mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-20 22:05:12 +00:00
Cubeb: rewrite locking
This commit is contained in:
parent
d636ea9338
commit
a1f9ff0aaa
9 changed files with 101 additions and 98 deletions
|
|
@ -292,6 +292,7 @@ private:
|
|||
audio_resampler resampler{};
|
||||
|
||||
atomic_t<bool> backend_active = false;
|
||||
atomic_t<bool> backend_device_changed = false;
|
||||
bool playing = false;
|
||||
|
||||
u64 update_timestamp = 0;
|
||||
|
|
@ -310,6 +311,7 @@ private:
|
|||
|
||||
void commit_data(f32* buf, u32 sample_cnt);
|
||||
u32 backend_write_callback(u32 size, void *buf);
|
||||
void backend_state_callback(AudioStateEvent event);
|
||||
|
||||
public:
|
||||
audio_ringbuffer(cell_audio_config &cfg);
|
||||
|
|
@ -345,9 +347,9 @@ public:
|
|||
return backend->Operational();
|
||||
}
|
||||
|
||||
bool device_changed() const
|
||||
bool device_changed()
|
||||
{
|
||||
return backend->DefaultDeviceChanged();
|
||||
return backend_device_changed.test_and_reset() && backend->DefaultDeviceChanged();
|
||||
}
|
||||
|
||||
std::string_view get_backend_name() const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue