static void
gst_validate_pad_monitor_check_aggregated_return (GstValidatePadMonitor *
- monitor, GstFlowReturn ret)
+ monitor, GstObject * parent, GstFlowReturn ret)
{
GstIterator *iter;
gboolean done;
return;
}
if (aggregated == GST_FLOW_OK || aggregated == GST_FLOW_EOS) {
- /* those are acceptable situations */
+ GstState state, pending;
+ /* those are acceptable situations */
if (GST_PAD_IS_FLUSHING (pad) && ret == GST_FLOW_FLUSHING) {
/* pad is flushing, always acceptable to return flushing */
return;
}
+ gst_element_get_state (GST_ELEMENT (parent), &state, &pending, 0);
+ if (ret == GST_FLOW_FLUSHING && (state < GST_STATE_PAUSED
+ || pending < GST_STATE_PAUSED)) {
+ /* Element is being teared down, accept FLOW_FLUSHING */
+
+ return;
+ }
+
if (monitor->is_eos && ret == GST_FLOW_EOS) {
/* this element received eos and returned eos */
return;
mark_pads_eos (pad_monitor);
}
if (PAD_PARENT_IS_DEMUXER (pad_monitor))
- gst_validate_pad_monitor_check_aggregated_return (pad_monitor, ret);
+ gst_validate_pad_monitor_check_aggregated_return (pad_monitor, parent, ret);
GST_VALIDATE_MONITOR_UNLOCK (pad_monitor);
GST_VALIDATE_PAD_MONITOR_PARENT_UNLOCK (pad_monitor);
if (percent == 100) {
/* a 100% message means buffering is done */
- gst_validate_printf (NULL, "Done buffering\n");
+ gst_validate_printf (NULL, "\nDone buffering\n");
if (monitor->buffering) {
monitor->print_pos_srcid =
g_timeout_add (PRINT_POSITION_TIMEOUT,
/* buffering... */
if (!monitor->buffering) {
monitor->buffering = TRUE;
- gst_validate_printf (NULL, "Start buffering\n");
+ gst_validate_printf (NULL, "\nStart buffering\n");
if (monitor->print_pos_srcid
&& g_source_remove (monitor->print_pos_srcid)) {
monitor->print_pos_srcid = 0;