When applying segments from the input samples, post a bus
error and fail loudly if the segment fails to configure, instead of
just posting debug output.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/783>
if (!gst_base_src_new_segment (bsrc, segment)) {
GST_ERROR_OBJECT (appsrc,
"Couldn't set new segment %" GST_PTR_FORMAT, event);
- ret = GST_FLOW_ERROR;
- break;
+ gst_event_unref (event);
+ goto invalid_segment;
}
gst_segment_copy_into (segment, &priv->current_segment);
}
GST_ERROR_SYSTEM);
return GST_FLOW_ERROR;
}
+
+invalid_segment:
+ {
+ g_mutex_unlock (&priv->mutex);
+ GST_ELEMENT_ERROR (appsrc, LIBRARY, SETTINGS,
+ (NULL), ("Failed to configure the provided input segment."));
+ return GST_FLOW_ERROR;
+ }
}
/* external API */