Skip to content

Commit

Permalink
Fixed playback_sensor::start
Browse files Browse the repository at this point in the history
  • Loading branch information
aangerma committed Aug 8, 2021
1 parent 280a85c commit 8501d96
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/media/playback/playback_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,18 @@ notifications_callback_ptr playback_sensor::get_notifications_callback() const
void playback_sensor::start(frame_callback_ptr callback)
{
LOG_DEBUG("Start sensor " << m_sensor_id);
std::lock_guard<std::mutex> l(m_mutex);
if (m_is_started == false)
bool was_started = false;
{
started(m_sensor_id, callback);
m_user_callback = callback ;
m_is_started = true;
std::lock_guard<std::mutex> l(m_mutex);
if (m_is_started == false)
{
m_is_started = true;
was_started = true;
m_user_callback = callback;
}
}
if(was_started)
started(m_sensor_id, callback);
}

void playback_sensor::stop(bool invoke_required)
Expand Down

0 comments on commit 8501d96

Please sign in to comment.