clocksync: Fix deadlock because of taken stream lock on flush-start

Deadlock happens when streaming thread is already blocked by downstream
and clocksync is trying to take stream lock on flush-start.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4772>
This commit is contained in:
Seungha Yang 2023-06-05 20:17:40 +09:00
parent 4aa3718c2d
commit a1c2df830b

View file

@ -609,17 +609,13 @@ gst_clock_sync_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
gst_clock_id_unschedule (clocksync->clock_id);
}
GST_OBJECT_UNLOCK (clocksync);
GST_PAD_STREAM_LOCK (pad);
gst_clock_sync_reset_qos (clocksync);
GST_PAD_STREAM_UNLOCK (pad);
break;
case GST_EVENT_FLUSH_STOP:
GST_OBJECT_LOCK (clocksync);
clocksync->flushing = FALSE;
gst_segment_init (&clocksync->segment, GST_FORMAT_UNDEFINED);
GST_OBJECT_UNLOCK (clocksync);
gst_clock_sync_reset_qos (clocksync);
clocksync->is_first = TRUE;
break;
default: