From 5c0e02c79c88f8dddcf9b93bd9f30d75c24ac82e Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Sat, 4 Aug 2012 11:48:13 -0300 Subject: [PATCH] basesrc: retry on not-negotiate if a reconfigure is pending Before erroring out on not-negotiated returns, check if the pad has the reconfigure flag set and retry. https://bugzilla.gnome.org/show_bug.cgi?id=681198 --- libs/gst/base/gstbasesrc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index 8714ab9a9c..56fd861503 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -2692,6 +2692,9 @@ gst_base_src_loop (GstPad * pad) ret = gst_pad_push (pad, buf); if (G_UNLIKELY (ret != GST_FLOW_OK)) { + if (ret == GST_FLOW_NOT_NEGOTIATED) { + goto not_negotiated; + } GST_INFO_OBJECT (src, "pausing after gst_pad_push() = %s", gst_flow_get_name (ret)); goto pause; @@ -2709,6 +2712,10 @@ done: /* special cases */ not_negotiated: { + if (gst_pad_needs_reconfigure (pad)) { + GST_DEBUG_OBJECT (src, "Retrying to renegotiate"); + return; + } GST_DEBUG_OBJECT (src, "Failed to renegotiate"); ret = GST_FLOW_NOT_NEGOTIATED; goto pause;