Fix state reset in cellMic, cellAudio, cellCamera (#6761)

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

View file

@ -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);