diff --git a/gst/videomixer/videomixer2.c b/gst/videomixer/videomixer2.c index 9c6398f2bb..1a0662215b 100644 --- a/gst/videomixer/videomixer2.c +++ b/gst/videomixer/videomixer2.c @@ -644,6 +644,7 @@ gst_videomixer2_reset (GstVideoMixer2 * mix) mix->newseg_pending = TRUE; g_atomic_int_set (&mix->flush_stop_pending, FALSE); + g_atomic_int_set (&mix->waiting_flush_stop, FALSE); } /* 1 == OK @@ -1734,13 +1735,13 @@ gst_videomixer2_sink_event (GstCollectPads * pads, GstCollectData * cdata, break; } case GST_EVENT_FLUSH_START: - g_atomic_int_set (&mix->flush_stop_pending, TRUE); + g_atomic_int_set (&mix->waiting_flush_stop, TRUE); ret = gst_collect_pads_event_default (pads, cdata, event, discard); event = NULL; break; case GST_EVENT_FLUSH_STOP: mix->newseg_pending = TRUE; - if (g_atomic_int_compare_and_exchange (&mix->flush_stop_pending, TRUE, + if (g_atomic_int_compare_and_exchange (&mix->waiting_flush_stop, TRUE, FALSE)) { GST_DEBUG_OBJECT (pad, "forwarding flush stop"); ret = gst_collect_pads_event_default (pads, cdata, event, discard); diff --git a/gst/videomixer/videomixer2.h b/gst/videomixer/videomixer2.h index b853256145..4a0b744eb9 100644 --- a/gst/videomixer/videomixer2.h +++ b/gst/videomixer/videomixer2.h @@ -97,7 +97,11 @@ struct _GstVideoMixer2 gboolean send_caps; gboolean newseg_pending; - gboolean flush_stop_pending; + gboolean flush_stop_pending; /* Used when we receive a flushing seek, + to send a flush_stop right before the + following buffer */ + gboolean waiting_flush_stop; /* Used when we receive a flush_start to make + sure to forward the flush_stop only once */ GstVideoMixer2Background background;