File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -416,6 +416,9 @@ void PulseAudioStream::on_write_requested(size_t bytes_to_write)
416416 VERIFY (m_write_callback);
417417 if (m_suspended)
418418 return ;
419+ auto callback_state = m_callback_state.load ();
420+ if (callback_state == CallbackState::Parked)
421+ return ;
419422 while (bytes_to_write > 0 ) {
420423 auto buffer = begin_write (bytes_to_write).release_value_but_fixme_should_propagate_errors ();
421424 auto frame_size = this ->frame_size ();
@@ -425,7 +428,6 @@ void PulseAudioStream::on_write_requested(size_t bytes_to_write)
425428 cancel_write ().release_value_but_fixme_should_propagate_errors ();
426429
427430 while (true ) {
428- auto callback_state = CallbackState::Active;
429431 if (m_callback_state.compare_exchange_strong (callback_state, CallbackState::Parked))
430432 break ;
431433 VERIFY (callback_state != CallbackState::Parked);
You can’t perform that action at this time.
0 commit comments