diff --git a/rpcs3/Emu/Cell/Modules/cellAudio.cpp b/rpcs3/Emu/Cell/Modules/cellAudio.cpp index e69292e8bc..f1d4a9a240 100644 --- a/rpcs3/Emu/Cell/Modules/cellAudio.cpp +++ b/rpcs3/Emu/Cell/Modules/cellAudio.cpp @@ -274,8 +274,8 @@ void audio_ringbuffer::process_resampled_data() { if (!cfg.time_stretching_enabled) return; - const auto samples = resampler.get_samples(static_cast(cb_ringbuf.get_free_size() / (cfg.audio_sample_size * static_cast(cfg.backend_ch_cnt)))); - commit_data(samples.first, samples.second); + const auto [buffer, samples] = resampler.get_samples(static_cast(cb_ringbuf.get_free_size() / (cfg.audio_sample_size * static_cast(cfg.backend_ch_cnt)))); + commit_data(buffer, samples); } void audio_ringbuffer::commit_data(f32* buf, u32 sample_cnt) @@ -455,7 +455,7 @@ std::tuple cell_audio_thread::count_port_buffer_tags() u32 untouched = 0; u32 incomplete = 0; - for (auto& port : ports) + for (audio_port& port : ports) { if (port.state != audio_port_state::started) continue; active++; @@ -526,7 +526,7 @@ std::tuple cell_audio_thread::count_port_buffer_tags() void cell_audio_thread::reset_ports(s32 offset) { // Memset buffer to 0 and tag - for (auto& port : ports) + for (audio_port& port : ports) { if (port.state != audio_port_state::started) continue; @@ -548,7 +548,7 @@ void cell_audio_thread::advance(u64 timestamp) // update ports reset_ports(0); - for (auto& port : ports) + for (audio_port& port : ports) { if (port.state != audio_port_state::started) continue; @@ -572,12 +572,11 @@ void cell_audio_thread::advance(u64 timestamp) // send aftermix event (normal audio event) std::array, MAX_AUDIO_EVENT_QUEUES> queues; - std::array event_sources; u32 queue_count = 0; event_period++; - for (const auto& key_inf : keys) + for (const key_info& key_inf : keys) { if (key_inf.flags & CELL_AUDIO_EVENTFLAG_NOMIX) { @@ -648,9 +647,9 @@ namespace audio if (auto& g_audio = g_fxo->get(); g_fxo->is_init()) { // Only reboot the audio renderer if a relevant setting changed - const auto new_raw = get_raw_config(); + const cell_audio_config::raw_config new_raw = get_raw_config(); - if (const auto raw = g_audio.cfg.raw; + if (const cell_audio_config::raw_config raw = g_audio.cfg.raw; force_reset || raw.audio_device != new_raw.audio_device || raw.desired_buffer_duration != new_raw.desired_buffer_duration || @@ -735,7 +734,7 @@ void cell_audio_thread::operator()() { loop_count++; - const auto update_req = m_update_configuration.observe(); + const audio_backend_update update_req = m_update_configuration.observe(); if (update_req != audio_backend_update::NONE) { cellAudio.warning("Updating cell_audio_thread configuration"); @@ -1057,7 +1056,7 @@ void cell_audio_thread::mix(float* out_buffer, s32 offset) std::memset(out_buffer, 0, out_buffer_sz * sizeof(float)); // mixing - for (auto& port : ports) + for (audio_port& port : ports) { if (port.state != audio_port_state::started) continue; @@ -1070,7 +1069,7 @@ void cell_audio_thread::mix(float* out_buffer, s32 offset) // spread port volume changes over 13ms auto step_volume = [master_volume, &m](audio_port& port) { - const auto param = port.level_set.load(); + const audio_port::level_set_t param = port.level_set.load(); if (param.inc != 0.0f) { @@ -1180,11 +1179,11 @@ void cell_audio_thread::mix(float* out_buffer, s32 offset) void cell_audio_thread::finish_port_volume_stepping() { // part of cellAudioSetPortLevel functionality - for (auto& port : ports) + for (audio_port& port : ports) { if (port.state != audio_port_state::started) continue; - const auto param = port.level_set.load(); + const audio_port::level_set_t param = port.level_set.load(); port.level = param.value; port.level_set.compare_and_swap(param, { param.value, 0.0f }); } @@ -1312,7 +1311,7 @@ error_code cellAudioPortOpen(vm::ptr audioParam, vm::ptr port portConfig->readIndexAddr = port.index; - switch (auto state = port.state.load()) + switch (audio_port_state state = port.state.load()) { case audio_port_state::closed: portConfig->status = CELL_AUDIO_STATUS_CLOSE; @@ -1414,7 +1413,7 @@ error_code cellAudioPortStart(u32 portNum) return CELL_AUDIO_ERROR_PARAM; } - switch (auto state = g_audio.ports[portNum].state.compare_and_swap(audio_port_state::opened, audio_port_state::started)) + switch (audio_port_state state = g_audio.ports[portNum].state.compare_and_swap(audio_port_state::opened, audio_port_state::started)) { case audio_port_state::closed: return CELL_AUDIO_ERROR_PORT_NOT_OPEN; case audio_port_state::started: return CELL_AUDIO_ERROR_PORT_ALREADY_RUN; @@ -1441,7 +1440,7 @@ error_code cellAudioPortClose(u32 portNum) return CELL_AUDIO_ERROR_PARAM; } - switch (auto state = g_audio.ports[portNum].state.exchange(audio_port_state::closed)) + switch (audio_port_state state = g_audio.ports[portNum].state.exchange(audio_port_state::closed)) { case audio_port_state::closed: return CELL_AUDIO_ERROR_PORT_NOT_OPEN; case audio_port_state::started: return CELL_OK; @@ -1468,7 +1467,7 @@ error_code cellAudioPortStop(u32 portNum) return CELL_AUDIO_ERROR_PARAM; } - switch (auto state = g_audio.ports[portNum].state.compare_and_swap(audio_port_state::started, audio_port_state::opened)) + switch (audio_port_state state = g_audio.ports[portNum].state.compare_and_swap(audio_port_state::started, audio_port_state::opened)) { case audio_port_state::closed: return CELL_AUDIO_ERROR_PORT_NOT_RUN; case audio_port_state::started: return CELL_OK; diff --git a/rpcs3/Emu/Cell/Modules/cellAudio.h b/rpcs3/Emu/Cell/Modules/cellAudio.h index 3b1b921d05..69780c82fd 100644 --- a/rpcs3/Emu/Cell/Modules/cellAudio.h +++ b/rpcs3/Emu/Cell/Modules/cellAudio.h @@ -389,6 +389,7 @@ public: u32 key_count = 0; u8 event_period = 0; + std::array event_sources{}; struct key_info {