From aa3e110a547a7ae5bf18241174363dd3c34172c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 20 Aug 2020 11:09:11 +0300 Subject: [PATCH] aggregator: Wake up source pad in PAUSED<->PLAYING transitions When going to PLAYING we will now have a clock and can stop waiting on the condition variable and instead start waiting on the clock if necessary for the current configuration. In the other direction when going to PAUSED the clock might have disappeared and we might need to wait on the condition variable again instead. Part-of: --- libs/gst/base/gstaggregator.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/gst/base/gstaggregator.c b/libs/gst/base/gstaggregator.c index ba1b22d..5eb028f 100644 --- a/libs/gst/base/gstaggregator.c +++ b/libs/gst/base/gstaggregator.c @@ -1876,6 +1876,11 @@ gst_aggregator_change_state (GstElement * element, GstStateChange transition) if (!gst_aggregator_start (self)) goto error_start; break; + 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_BROADCAST (self); + break; default: break; } @@ -1893,6 +1898,11 @@ gst_aggregator_change_state (GstElement * element, GstStateChange transition) GST_ERROR_OBJECT (self, "Subclass failed to stop."); } break; + 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_BROADCAST (self); + break; default: break; } -- 2.7.4