diff options
author | Jan Schmidt <jan@centricular.com> | 2020-08-11 03:45:32 +1000 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2020-08-11 07:35:56 +0000 |
commit | b18fd0f239e17ae4daf30eab11033cfbe72fe95d (patch) | |
tree | 55db47cc59af33e6735359a275dd59dd9541b561 | |
parent | 42b3025bdc6103721da13ed14b982c98e235b9a8 (diff) | |
download | gstreamer-plugins-base-b18fd0f239e17ae4daf30eab11033cfbe72fe95d.tar.gz |
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>
-rw-r--r-- | gst-libs/gst/app/gstappsrc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gst-libs/gst/app/gstappsrc.c b/gst-libs/gst/app/gstappsrc.c index a6e335fb3..2df2e730b 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 */ |