mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
imagefreeze: Wait until we have a clock
Otherwise it can happen that it tries to get the clock in PAUSED state in live mode, which does not exist. Thanks to Sebastian Dröge for helping debugging. Fixes #775 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/691>
This commit is contained in:
parent
a27e171bfa
commit
af9e66d7a5
1 changed files with 7 additions and 2 deletions
|
@ -962,19 +962,24 @@ gst_image_freeze_src_loop (GstPad * pad)
|
||||||
GstClockReturn clock_ret;
|
GstClockReturn clock_ret;
|
||||||
GstClock *clock;
|
GstClock *clock;
|
||||||
|
|
||||||
|
clock = gst_element_get_clock (GST_ELEMENT (self));
|
||||||
|
|
||||||
/* Wait until the element went to PLAYING or flushing */
|
/* Wait until the element went to PLAYING or flushing */
|
||||||
while (self->blocked && !self->flushing)
|
while ((!clock || self->blocked) && !self->flushing) {
|
||||||
g_cond_wait (&self->blocked_cond, &self->lock);
|
g_cond_wait (&self->blocked_cond, &self->lock);
|
||||||
|
gst_clear_object (&clock);
|
||||||
|
clock = gst_element_get_clock (GST_ELEMENT (self));
|
||||||
|
}
|
||||||
|
|
||||||
if (self->flushing) {
|
if (self->flushing) {
|
||||||
g_mutex_unlock (&self->lock);
|
g_mutex_unlock (&self->lock);
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
flow_ret = GST_FLOW_FLUSHING;
|
flow_ret = GST_FLOW_FLUSHING;
|
||||||
|
gst_clear_object (&clock);
|
||||||
goto pause_task;
|
goto pause_task;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wait on the clock until the time for our current frame is reached */
|
/* Wait on the clock until the time for our current frame is reached */
|
||||||
clock = gst_element_get_clock (GST_ELEMENT (self));
|
|
||||||
base_time = gst_element_get_base_time (GST_ELEMENT (self));
|
base_time = gst_element_get_base_time (GST_ELEMENT (self));
|
||||||
if (self->fps_n != 0) {
|
if (self->fps_n != 0) {
|
||||||
clock_time =
|
clock_time =
|
||||||
|
|
Loading…
Reference in a new issue