Skip to content

Commit 71b467f

Browse files
committed
Fix re-entrant call to VideoSession::reset().
1 parent 154e25d commit 71b467f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

SerialPrograms/Source/CommonFramework/Globals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace PokemonAutomation{
2626
const bool IS_BETA_VERSION = true;
2727
const int PROGRAM_VERSION_MAJOR = 0;
2828
const int PROGRAM_VERSION_MINOR = 55;
29-
const int PROGRAM_VERSION_PATCH = 1;
29+
const int PROGRAM_VERSION_PATCH = 2;
3030

3131
const std::string PROGRAM_VERSION_BASE =
3232
"v" + std::to_string(PROGRAM_VERSION_MAJOR) +

SerialPrograms/Source/CommonFramework/VideoPipeline/VideoSession.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void VideoSession::set(const VideoSourceOption& option){
9191

9292
void VideoSession::reset(){
9393
m_logger.log("Resetting the video...", COLOR_GREEN);
94-
dispatch_to_main_thread([this]{
94+
queue_on_main_thread([this]{
9595
std::lock_guard<std::mutex> lg0(m_reset_lock);
9696

9797
m_state_listeners.run_method_unique(&StateListener::pre_shutdown);
@@ -124,7 +124,7 @@ void VideoSession::set_source(
124124
Resolution resolution
125125
){
126126
m_logger.log("Changing video...", COLOR_GREEN);
127-
dispatch_to_main_thread([this, device, resolution]{
127+
queue_on_main_thread([this, device, resolution]{
128128
std::lock_guard<std::mutex> lg0(m_reset_lock);
129129
if (*m_descriptor == *device && !m_descriptor->should_reload()){
130130
return;
@@ -163,7 +163,7 @@ void VideoSession::set_source(
163163
}
164164
void VideoSession::set_resolution(Resolution resolution){
165165
m_logger.log("Changing resolution...", COLOR_GREEN);
166-
dispatch_to_main_thread([this, resolution]{
166+
queue_on_main_thread([this, resolution]{
167167
std::lock_guard<std::mutex> lg0(m_reset_lock);
168168
if (m_option.m_resolution == resolution){
169169
return;

0 commit comments

Comments
 (0)