appsrc: Post a bus error if a segment can't be applied

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>
This commit is contained in:
Jan Schmidt 2020-08-11 03:45:32 +10:00 committed by GStreamer Merge Bot
parent 42b3025bdc
commit b18fd0f239

View file

@ -1324,8 +1324,8 @@ gst_app_src_create (GstBaseSrc * bsrc, guint64 offset, guint size,
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);
}
@ -1405,6 +1405,14 @@ seek_error:
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 */