mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-10-01 13:44:40 +00:00
gst: sink: Disable active state setting when going to PAUSED
On first start, the stream is set to be active when connected. However, when the element is going to PAUSED and not subsequently to PLAYING, this is incorrect behaviour. Fixes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4049
This commit is contained in:
parent
a9bf5fa24a
commit
9da01413a1
|
@ -792,6 +792,15 @@ gst_pipewire_sink_change_state (GstElement * element, GstStateChange transition)
|
|||
goto open_failed;
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||
/* the initial stream state is active, which is needed for linking and
|
||||
* negotiation to happen and the bufferpool to be set up. We don't know
|
||||
* if we'll go to plaing, so we deactivate the stream until that
|
||||
* transition happens. This is janky, but because of how bins propagate
|
||||
* state changes one transition at a time, there may not be a better way
|
||||
* to do this. PAUSED -> READY -> PAUSED transitions, this is a noop */
|
||||
pw_thread_loop_lock (this->stream->core->loop);
|
||||
pw_stream_set_active(this->stream->pwstream, false);
|
||||
pw_thread_loop_unlock (this->stream->core->loop);
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||
/* uncork and start play */
|
||||
|
|
Loading…
Reference in a new issue