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>
g_cond_wait (&self->cond, &self->lock);
}
- if (G_UNLIKELY (!is_running (self))) {
- gst_buffer_unref (message);
- ret = GST_FLOW_FLUSHING;
- } else if (G_UNLIKELY (!self->connection)) {
+ if (G_UNLIKELY (!self->connection)) {
gst_buffer_unref (message);
/* send_connect_error has sent an ERROR message */
ret = GST_FLOW_ERROR;
+ } else if (G_UNLIKELY (!is_running (self))) {
+ gst_buffer_unref (message);
+ ret = GST_FLOW_FLUSHING;
} else {
send_streamheader (self);
send_message (self, message);