diff --git a/src/media/playback/playback_device.cpp b/src/media/playback/playback_device.cpp index beab1a74b4..0a63f73f38 100644 --- a/src/media/playback/playback_device.cpp +++ b/src/media/playback/playback_device.cpp @@ -151,7 +151,6 @@ rs2_extrinsics playback_device::calc_extrinsic(const rs2_extrinsics& from, const playback_device::~playback_device() { - (*m_read_thread)->invoke([this](dispatcher::cancellable_timer c) { std::lock_guard locker(_active_sensors_mutex); for (auto&& sensor : m_active_sensors) @@ -161,12 +160,6 @@ playback_device::~playback_device() sensor.second->stop(); } } - }); - - if((*m_read_thread)->flush() == false) - { - LOG_ERROR("Error - timeout waiting for flush, possible deadlock detected"); - assert(0); //Detect this immediately in debug } (*m_read_thread)->stop(); @@ -454,8 +447,8 @@ void playback_device::start() catch_up(); try_looping(); LOG_INFO("Playback started"); - } + void playback_device::stop() { LOG_DEBUG("playback stop called"); @@ -469,8 +462,8 @@ void playback_device::stop() LOG_ERROR("Error - timeout waiting for flush, possible deadlock detected"); assert(0); //Detect this immediately in debug } - LOG_INFO("Playback stoped"); + LOG_INFO("Playback stopped"); } void playback_device::stop_internal() @@ -482,10 +475,7 @@ void playback_device::stop_internal() m_is_started = false; m_is_paused = false; - for (auto sensor : m_sensors) - { - //sensor.second->flush_pending_frames(); - } + m_reader->reset(); m_prev_timestamp = std::chrono::nanoseconds(0); catch_up(); @@ -524,7 +514,6 @@ void playback_device::do_loop(T action) { if( psc ) { - psc->flush_pending_frames(); psc->stop( false ); } } diff --git a/unit-tests/live/rec-play/test-got-playback-frames.py b/unit-tests/live/rec-play/test-got-playback-frames.py index 9d7892b9fa..8b442f4930 100644 --- a/unit-tests/live/rec-play/test-got-playback-frames.py +++ b/unit-tests/live/rec-play/test-got-playback-frames.py @@ -183,16 +183,14 @@ def stop_sensor( sensor ): except Exception: test.unexpected_exception() finally: # we must remove all references to the file so we can use it again in the next test - if recorder: - recorder.pause() - recorder = None - if playback: - playback.pause() - playback = None stop_sensor( depth_sensor ) depth_sensor = None stop_sensor( color_sensor ) color_sensor = None + if recorder: + recorder = None + if playback: + playback = None test.finish() @@ -240,16 +238,14 @@ def stop_sensor( sensor ): except Exception: test.unexpected_exception() finally: # we must remove all references to the file so the temporary folder can be deleted - if recorder: - recorder.pause() - recorder = None - if playback: - playback.pause() - playback = None stop_sensor( depth_sensor ) depth_sensor = None stop_sensor( color_sensor ) color_sensor = None + if recorder: + recorder = None + if playback: + playback = None test.finish() diff --git a/unit-tests/py/rspy/libci.py b/unit-tests/py/rspy/libci.py index 760cee8567..a4c124d03f 100644 --- a/unit-tests/py/rspy/libci.py +++ b/unit-tests/py/rspy/libci.py @@ -359,6 +359,10 @@ def command( self ): # -S : don't imply 'import site' on initialization # NOTE: exit() is defined in site.py and works only if the site module is imported! cmd += ['-S'] + # -u : force the stdout and stderr streams to be unbuffered; same as PYTHONUNBUFFERED=1 + # With buffering we may end up losing output in case of crashes! (in Python 3.7 the text layer of the + # streams is unbuffered, but we assume 3.6) + cmd += ['-u'] if sys.flags.verbose: cmd += ["-v"] cmd += [self.path_to_script]