diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2014-06-12 13:23:29 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2014-06-13 09:19:49 +0100 |
commit | 593a52a6563303f647d08171336aaf66f5664722 (patch) | |
tree | af93263aadc31a3681beb1650d885d564b47da15 /gst | |
parent | 072fa3543eae53b889c35fd32e00c7b5c1c58df6 (diff) |
tcpserversrc: return FLOW_FLUSHING instead of an error when accept/select is canceled
Canceling the accept/select happens when the source is shut down. This is
not an error and the GST_FLOW_ERROR causes problems when only part of the
pipeline is shut down.
https://bugzilla.gnome.org/show_bug.cgi?id=731567
Diffstat (limited to 'gst')
-rw-r--r-- | gst/tcp/gsttcpserversrc.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gst/tcp/gsttcpserversrc.c b/gst/tcp/gsttcpserversrc.c index 141181dcf..4bd56af52 100644 --- a/gst/tcp/gsttcpserversrc.c +++ b/gst/tcp/gsttcpserversrc.c @@ -295,19 +295,27 @@ accept_error: { if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { GST_DEBUG_OBJECT (src, "Cancelled accepting of client"); + ret = GST_FLOW_FLUSHING; } else { GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL), ("Failed to accept client: %s", err->message)); + ret = GST_FLOW_ERROR; } g_clear_error (&err); - return GST_FLOW_ERROR; + return ret; } select_error: { - GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), - ("Select failed: %s", err->message)); + if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + GST_DEBUG_OBJECT (src, "Cancelled select"); + ret = GST_FLOW_FLUSHING; + } else { + GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL), + ("Select failed: %s", err->message)); + ret = GST_FLOW_ERROR; + } g_clear_error (&err); - return GST_FLOW_ERROR; + return ret; } get_available_error: { |