13
0

PulseAudio: clean up freewheeling transitions

ae3c8b19c6 and 03a17df68c reworked the transitions to and from
freewheeling. Some of it seems to have been experiments that tried
several things out, and generally it seems to have worked. It left some
commented out code. Clean that up.
This commit is contained in:
Mads Kiilerich 2022-11-01 19:16:45 +01:00 committed by Robin Gareus
parent 04c24be2db
commit 27a2bf1f59
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -994,12 +994,6 @@ PulseAudioBackend::main_process_thread ()
manager.registration_callback (); manager.registration_callback ();
manager.graph_order_callback (); manager.graph_order_callback ();
#if 0
/* flush stream */
pa_threaded_mainloop_lock (p_mainloop);
sync_pulse (pa_stream_flush (p_stream, stream_operation_cb, this));
#endif
/* begin streaming */ /* begin streaming */
if (!cork_pulse (false)) { if (!cork_pulse (false)) {
_active = false; _active = false;
@ -1017,13 +1011,14 @@ PulseAudioBackend::main_process_thread ()
engine.freewheel_callback (_freewheel); engine.freewheel_callback (_freewheel);
if (_freewheel) { if (_freewheel) {
/* when transitioning to freewheeling, cork it and stop writing */
assert (!pa_stream_is_corked (p_stream)); assert (!pa_stream_is_corked (p_stream));
if (!cork_pulse (true)) { if (!cork_pulse (true)) {
break; break;
} }
} }
/* flush stream before and after freewheeling */ /* flush corked stream before and after freewheeling */
assert (pa_stream_is_corked (p_stream)); assert (pa_stream_is_corked (p_stream));
pa_threaded_mainloop_lock (p_mainloop); pa_threaded_mainloop_lock (p_mainloop);
_operation_succeeded = false; _operation_succeeded = false;
@ -1032,16 +1027,11 @@ PulseAudioBackend::main_process_thread ()
} }
if (!_freewheel) { if (!_freewheel) {
/* when transitioning from freewheeling, uncork after flushing and start writing */
if (!cork_pulse (false)) { if (!cork_pulse (false)) {
break; break;
} }
#if 0
pa_threaded_mainloop_lock (p_mainloop);
_operation_succeeded = false;
if (!sync_pulse (pa_stream_drain (p_stream, stream_operation_cb, this)) || !_operation_succeeded) {
break;
}
#endif
_dsp_load_calc.reset (); _dsp_load_calc.reset ();
} }
} }