1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2025-03-15 04:21:01 +00:00

Fix state reset in cellMic, cellAudio, cellCamera ()

This commit is contained in:
Eladash 2019-10-13 19:26:11 +03:00 committed by Ivan
parent 42aa4c5000
commit 1d07c40aa5
4 changed files with 20 additions and 2 deletions

@ -952,6 +952,7 @@ error_code cellAudioInit()
g_audio->ports[i].number = i;
g_audio->ports[i].addr = g_audio_buffer + AUDIO_PORT_OFFSET * i;
g_audio->ports[i].index = g_audio_indices + i;
g_audio->ports[i].state = audio_port_state::closed;
}
g_audio->init = 1;
@ -973,6 +974,7 @@ error_code cellAudioQuit(ppu_thread& ppu)
}
// TODO
g_audio->keys.clear();
g_audio->init = 0;
return CELL_OK;

@ -394,6 +394,7 @@ error_code cellCameraEnd()
// TODO
g_camera->init = 0;
g_camera->reset_state();
return CELL_OK;
}
@ -1356,6 +1357,19 @@ void camera_context::operator()()
}
}
void camera_context::reset_state()
{
read_mode = CELL_CAMERA_READ_FUNCCALL;
is_streaming = false;
is_attached = false;
is_open = false;
info.framerate = 0;
std::memset(&attr, 0, sizeof(attr));
std::scoped_lock lock(mutex_notify_data_map);
notify_data_map.clear();
}
void camera_context::send_attach_state(bool attached)
{
std::lock_guard lock(mutex_notify_data_map);

@ -360,6 +360,7 @@ class camera_context
public:
void operator()();
void reset_state();
void send_attach_state(bool attached);
void set_attr(s32 attrib, u32 arg1, u32 arg2);
@ -388,7 +389,7 @@ public:
atomic_t<bool> is_attached{false};
atomic_t<bool> is_open{false};
CellCameraInfoEx info;
CellCameraInfoEx info{};
struct attr_t
{

@ -85,7 +85,7 @@ void mic_context::load_config_and_init()
{
auto device_list = fmt::split(g_cfg.audio.microphone_devices, {"@@@"});
if (device_list.size())
if (device_list.size() && mic_list.empty())
{
switch (g_cfg.audio.microphone_type)
{
@ -481,6 +481,7 @@ s32 cellMicEnd(ppu_thread& ppu)
// TODO
mic_thr->init = 0;
mic_thr->event_queue_key = 0;
return CELL_OK;
}