From b18fd0f239e17ae4daf30eab11033cfbe72fe95d Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Tue, 11 Aug 2020 03:45:32 +1000 Subject: [PATCH] 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: --- gst-libs/gst/app/gstappsrc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/app/gstappsrc.c b/gst-libs/gst/app/gstappsrc.c index a6e335f..2df2e73 100644 --- a/gst-libs/gst/app/gstappsrc.c +++ b/gst-libs/gst/app/gstappsrc.c @@ -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 */ -- 2.7.4