aggregator: Hold SRC_LOCK while unblocking via SRC_BROADCAST()

Otherwise the clock id we access might not be a valid pointer anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/656>
This commit is contained in:
Sebastian Dröge 2020-09-18 09:59:03 +03:00 committed by GStreamer Merge Bot
parent 30151e6f40
commit b2b1610907

View file

@ -1837,7 +1837,9 @@ gst_aggregator_change_state (GstElement * element, GstStateChange transition)
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
/* Wake up any waiting as now we have a clock and can do
* proper waiting on the clock if necessary */
SRC_LOCK (self);
SRC_BROADCAST (self);
SRC_UNLOCK (self);
break;
default:
break;
@ -1859,7 +1861,9 @@ gst_aggregator_change_state (GstElement * element, GstStateChange transition)
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
/* Wake up any waiting as now clock might be gone and we might
* need to wait on the condition variable again */
SRC_LOCK (self);
SRC_BROADCAST (self);
SRC_UNLOCK (self);
break;
default:
break;