mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-17 19:21:04 +00:00
Fix state reset in cellMic, cellAudio, cellCamera (#6761)
This commit is contained in:
parent
42aa4c5000
commit
1d07c40aa5
@ -952,6 +952,7 @@ error_code cellAudioInit()
|
|||||||
g_audio->ports[i].number = i;
|
g_audio->ports[i].number = i;
|
||||||
g_audio->ports[i].addr = g_audio_buffer + AUDIO_PORT_OFFSET * 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].index = g_audio_indices + i;
|
||||||
|
g_audio->ports[i].state = audio_port_state::closed;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_audio->init = 1;
|
g_audio->init = 1;
|
||||||
@ -973,6 +974,7 @@ error_code cellAudioQuit(ppu_thread& ppu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
g_audio->keys.clear();
|
||||||
g_audio->init = 0;
|
g_audio->init = 0;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
|
@ -394,6 +394,7 @@ error_code cellCameraEnd()
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
g_camera->init = 0;
|
g_camera->init = 0;
|
||||||
|
g_camera->reset_state();
|
||||||
return CELL_OK;
|
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)
|
void camera_context::send_attach_state(bool attached)
|
||||||
{
|
{
|
||||||
std::lock_guard lock(mutex_notify_data_map);
|
std::lock_guard lock(mutex_notify_data_map);
|
||||||
|
@ -360,6 +360,7 @@ class camera_context
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
void operator()();
|
void operator()();
|
||||||
|
void reset_state();
|
||||||
void send_attach_state(bool attached);
|
void send_attach_state(bool attached);
|
||||||
void set_attr(s32 attrib, u32 arg1, u32 arg2);
|
void set_attr(s32 attrib, u32 arg1, u32 arg2);
|
||||||
|
|
||||||
@ -388,7 +389,7 @@ public:
|
|||||||
atomic_t<bool> is_attached{false};
|
atomic_t<bool> is_attached{false};
|
||||||
atomic_t<bool> is_open{false};
|
atomic_t<bool> is_open{false};
|
||||||
|
|
||||||
CellCameraInfoEx info;
|
CellCameraInfoEx info{};
|
||||||
|
|
||||||
struct attr_t
|
struct attr_t
|
||||||
{
|
{
|
||||||
|
@ -85,7 +85,7 @@ void mic_context::load_config_and_init()
|
|||||||
{
|
{
|
||||||
auto device_list = fmt::split(g_cfg.audio.microphone_devices, {"@@@"});
|
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)
|
switch (g_cfg.audio.microphone_type)
|
||||||
{
|
{
|
||||||
@ -481,6 +481,7 @@ s32 cellMicEnd(ppu_thread& ppu)
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
mic_thr->init = 0;
|
mic_thr->init = 0;
|
||||||
|
mic_thr->event_queue_key = 0;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user