diff --git a/gst/debugutils/gstwatchdog.c b/gst/debugutils/gstwatchdog.c index 1a30ed1f63..fe48448ad7 100644 --- a/gst/debugutils/gstwatchdog.c +++ b/gst/debugutils/gstwatchdog.c @@ -211,7 +211,23 @@ static void gst_watchdog_feed (GstWatchdog * watchdog, gpointer mini_object, gboolean force) { if (watchdog->source) { - if (watchdog->waiting_for_a_buffer) { + if (watchdog->waiting_for_flush_start) { + if (mini_object && GST_IS_EVENT (mini_object) && + GST_EVENT_TYPE (mini_object) == GST_EVENT_FLUSH_START) { + watchdog->waiting_for_flush_start = FALSE; + watchdog->waiting_for_flush_stop = TRUE; + } + + force = TRUE; + } else if (watchdog->waiting_for_flush_stop) { + if (mini_object && GST_IS_EVENT (mini_object) && + GST_EVENT_TYPE (mini_object) == GST_EVENT_FLUSH_STOP) { + watchdog->waiting_for_flush_stop = FALSE; + watchdog->waiting_for_a_buffer = TRUE; + } + + force = TRUE; + } else if (watchdog->waiting_for_a_buffer) { if (mini_object && GST_IS_BUFFER (mini_object)) { watchdog->waiting_for_a_buffer = FALSE; GST_DEBUG_OBJECT (watchdog, "Got a buffer \\o/"); @@ -330,7 +346,7 @@ gst_watchdog_src_event (GstBaseTransform * trans, GstEvent * event) if (flags & GST_SEEK_FLAG_FLUSH) { force = TRUE; GST_DEBUG_OBJECT (watchdog, "Got a FLUSHING seek, we need a buffer now!"); - watchdog->waiting_for_a_buffer = TRUE; + watchdog->waiting_for_flush_start = TRUE; } } diff --git a/gst/debugutils/gstwatchdog.h b/gst/debugutils/gstwatchdog.h index c146c66dbd..b296e0f1fd 100644 --- a/gst/debugutils/gstwatchdog.h +++ b/gst/debugutils/gstwatchdog.h @@ -47,6 +47,8 @@ struct _GstWatchdog GSource *source; gboolean waiting_for_a_buffer; + gboolean waiting_for_flush_start; + gboolean waiting_for_flush_stop; }; struct _GstWatchdogClass