diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2020-03-09 20:27:58 +0200 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2020-09-25 00:33:43 +0000 |
commit | 27e766137c7d4c7237896356bd90d6a37aa929e2 (patch) | |
tree | 18a932fd8684a6b36096383af323d510eb29c5f3 | |
parent | 95c8d8e4b524ff8b4c755a8d0075df52d588dabe (diff) | |
download | gstreamer-27e766137c7d4c7237896356bd90d6a37aa929e2.tar.gz |
identity: Unblock condition variable on FLUSH_START
... and immediately return FLUSHING from the streaming thread instead of
waiting potentially forever.
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/516
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/397>
-rw-r--r-- | plugins/elements/gstidentity.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/elements/gstidentity.c b/plugins/elements/gstidentity.c index e97fe498e0..b88a7d34aa 100644 --- a/plugins/elements/gstidentity.c +++ b/plugins/elements/gstidentity.c @@ -334,7 +334,7 @@ gst_identity_do_sync (GstIdentity * identity, GstClockTime running_time) return GST_FLOW_FLUSHING; } - while (identity->blocked) + while (identity->blocked && !identity->flushing) g_cond_wait (&identity->blocked_cond, GST_OBJECT_GET_LOCK (identity)); if (identity->flushing) { @@ -464,6 +464,7 @@ gst_identity_sink_event (GstBaseTransform * trans, GstEvent * event) if (GST_EVENT_TYPE (event) == GST_EVENT_FLUSH_START) { GST_OBJECT_LOCK (identity); identity->flushing = TRUE; + g_cond_broadcast (&identity->blocked_cond); if (identity->clock_id) { GST_DEBUG_OBJECT (identity, "unlock clock wait"); gst_clock_id_unschedule (identity->clock_id); |