mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
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:
parent
2bd541c70c
commit
bd1c9aedbc
Notes:
github-actions[bot]
2025-12-03 18:22:00 +00:00
Author: https://github.com/Zaggy1024
Commit: bd1c9aedbc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6971
2 changed files with 4 additions and 16 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue