mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pipewiresink: active stream after finishing preoll when changing state from paused to playing
This commit is contained in:
parent
90f8b0e40b
commit
152a6683ef
1 changed files with 10 additions and 7 deletions
|
|
@ -926,13 +926,6 @@ gst_pipewire_sink_change_state (GstElement * element, GstStateChange transition)
|
||||||
pw_stream_set_active(this->stream->pwstream, false);
|
pw_stream_set_active(this->stream->pwstream, false);
|
||||||
pw_thread_loop_unlock (this->stream->core->loop);
|
pw_thread_loop_unlock (this->stream->core->loop);
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
|
||||||
/* uncork and start play */
|
|
||||||
pw_thread_loop_lock (this->stream->core->loop);
|
|
||||||
pw_stream_set_active(this->stream->pwstream, true);
|
|
||||||
pw_thread_loop_unlock (this->stream->core->loop);
|
|
||||||
gst_buffer_pool_set_flushing(GST_BUFFER_POOL_CAST(this->stream->pool), FALSE);
|
|
||||||
break;
|
|
||||||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
||||||
/* stop play ASAP by corking */
|
/* stop play ASAP by corking */
|
||||||
pw_thread_loop_lock (this->stream->core->loop);
|
pw_thread_loop_lock (this->stream->core->loop);
|
||||||
|
|
@ -947,6 +940,16 @@ gst_pipewire_sink_change_state (GstElement * element, GstStateChange transition)
|
||||||
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||||
|
/* For some cases, the param_changed event is earlier than the state switch
|
||||||
|
* from paused state to playing state which will wait until buffer pool is ready.
|
||||||
|
* Guarantee to finish preoll if needed to active buffer pool before uncorking and
|
||||||
|
* starting play */
|
||||||
|
pw_thread_loop_lock (this->stream->core->loop);
|
||||||
|
pw_stream_set_active(this->stream->pwstream, true);
|
||||||
|
pw_thread_loop_unlock (this->stream->core->loop);
|
||||||
|
gst_buffer_pool_set_flushing(GST_BUFFER_POOL_CAST(this->stream->pool), FALSE);
|
||||||
|
break;
|
||||||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue