mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-09 13:30:06 -05:00
gst: protect negotiated field with lock
Move the lock around the negotiated field. See !1287
This commit is contained in:
parent
a4998e0b87
commit
5363bdcfcb
1 changed files with 4 additions and 1 deletions
|
|
@ -1026,10 +1026,10 @@ gst_pipewire_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
|
|||
|
||||
pwsrc = GST_PIPEWIRE_SRC (psrc);
|
||||
|
||||
pw_thread_loop_lock (pwsrc->core->loop);
|
||||
if (!pwsrc->negotiated)
|
||||
goto not_negotiated;
|
||||
|
||||
pw_thread_loop_lock (pwsrc->core->loop);
|
||||
while (TRUE) {
|
||||
enum pw_stream_state state;
|
||||
|
||||
|
|
@ -1126,6 +1126,7 @@ gst_pipewire_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
|
|||
|
||||
not_negotiated:
|
||||
{
|
||||
pw_thread_loop_unlock (pwsrc->core->loop);
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
}
|
||||
streaming_eos:
|
||||
|
|
@ -1348,7 +1349,9 @@ gst_pipewire_src_change_state (GstElement * element, GstStateChange transition)
|
|||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
pw_thread_loop_lock (this->core->loop);
|
||||
this->negotiated = FALSE;
|
||||
pw_thread_loop_unlock (this->core->loop);
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||
gst_pipewire_src_close (this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue