From 1860712098ea997804a21ea03a85b8911044db86 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Thu, 5 Sep 2013 11:46:46 -0300 Subject: [PATCH] pad-monitor: allow flushing flow returns when pad is flushing It should always be acceptable to return GST_FLOW_FLUSHING when the pad is flushing --- validate/gst/validate/gst-validate-pad-monitor.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/validate/gst/validate/gst-validate-pad-monitor.c b/validate/gst/validate/gst-validate-pad-monitor.c index a9c9316..8fe7122 100644 --- a/validate/gst/validate/gst-validate-pad-monitor.c +++ b/validate/gst/validate/gst-validate-pad-monitor.c @@ -856,10 +856,9 @@ gst_validate_pad_monitor_check_aggregated_return (GstValidatePadMonitor * GstValidatePadMonitor *othermonitor; GstFlowReturn aggregated = GST_FLOW_NOT_LINKED; gboolean found_a_pad = FALSE; + GstPad *pad = GST_VALIDATE_PAD_MONITOR_GET_PAD (monitor); - iter = - gst_pad_iterate_internal_links (GST_VALIDATE_PAD_MONITOR_GET_PAD - (monitor)); + iter = gst_pad_iterate_internal_links (pad); done = FALSE; while (!done) { GValue value = { 0, }; @@ -902,6 +901,11 @@ gst_validate_pad_monitor_check_aggregated_return (GstValidatePadMonitor * if (aggregated == GST_FLOW_OK || aggregated == GST_FLOW_EOS) { /* those are acceptable situations */ + if (GST_PAD_IS_FLUSHING (pad) && ret == GST_FLOW_FLUSHING) { + /* pad is flushing, always acceptable to return flushing */ + return; + } + if (monitor->is_eos && ret == GST_FLOW_EOS) { /* this element received eos and returned eos */ return; @@ -1125,6 +1129,7 @@ gst_validate_pad_monitor_flush (GstValidatePadMonitor * pad_monitor) pad_monitor->timestamp_range_end = GST_CLOCK_TIME_NONE; pad_monitor->has_segment = FALSE; pad_monitor->is_eos = FALSE; + pad_monitor->last_flow_return = GST_FLOW_OK; gst_caps_replace (&pad_monitor->last_caps, NULL); pad_monitor->caps_is_audio = pad_monitor->caps_is_video = FALSE; -- 2.7.4