rtmp2sink: Correctly return GST_FLOW_ERROR on error

If there is an error while connecting, the streaming task will be stopped, and
is_running() will be false, causing a GST_FLOW_FLUSHING to be returned. Instead,
we perform the error check (!self->connection) first, to return an error if
that's what occured.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3189>
This commit is contained in:
Arun Raghavan 2022-10-14 16:21:07 -04:00 committed by GStreamer Marge Bot
parent ece84d69a2
commit 34ca46c786

View file

@ -861,13 +861,13 @@ gst_rtmp2_sink_render (GstBaseSink * sink, GstBuffer * buffer)
g_cond_wait (&self->cond, &self->lock); g_cond_wait (&self->cond, &self->lock);
} }
if (G_UNLIKELY (!is_running (self))) { if (G_UNLIKELY (!self->connection)) {
gst_buffer_unref (message);
ret = GST_FLOW_FLUSHING;
} else if (G_UNLIKELY (!self->connection)) {
gst_buffer_unref (message); gst_buffer_unref (message);
/* send_connect_error has sent an ERROR message */ /* send_connect_error has sent an ERROR message */
ret = GST_FLOW_ERROR; ret = GST_FLOW_ERROR;
} else if (G_UNLIKELY (!is_running (self))) {
gst_buffer_unref (message);
ret = GST_FLOW_FLUSHING;
} else { } else {
send_streamheader (self); send_streamheader (self);
send_message (self, message); send_message (self, message);