LibMedia: Only set data provider error state from the decoding thread

...and use that assumption to avoid locking when checking if we're in
that state.
This commit is contained in:
Zaggy1024 2025-11-28 17:43:28 -06:00 committed by Gregory Bertilson
parent 2bd541c70c
commit bd1c9aedbc
Notes: github-actions[bot] 2025-12-03 18:22:00 +00:00
2 changed files with 4 additions and 16 deletions

View file

@ -361,8 +361,6 @@ void VideoDataProvider::ThreadData::push_data_and_decode_some_frames()
// before this functionality can exist.
auto set_error_and_wait_for_seek = [this](DecoderError&& error) {
auto is_in_error_state = true;
{
auto locker = take_lock();
m_is_in_error_state = true;
@ -373,14 +371,12 @@ void VideoDataProvider::ThreadData::push_data_and_decode_some_frames()
}
dbgln_if(PLAYBACK_MANAGER_DEBUG, "Video Data Provider: Encountered an error, waiting for a seek to start decoding again...");
while (is_in_error_state) {
while (m_is_in_error_state) {
if (handle_seek())
break;
{
auto locker = take_lock();
m_wait_condition.wait();
is_in_error_state = m_is_in_error_state;
}
}
};