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/630>
This commit is contained in:
Sebastian Dröge 2020-09-18 09:59:03 +03:00 committed by GStreamer Merge Bot
parent 7d12aa07d4
commit 46305b292f

View file

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