diff options
author | Kristofer Bjorkstrom <kristofb@axis.com> | 2019-02-18 15:24:18 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2019-05-01 17:42:51 +0100 |
commit | 7de5af4116a7d536b9f2758951893cb82945d5be (patch) | |
tree | c0a6b7e6c748f89050ae031d25cc5419bf4e671f | |
parent | 728a09d4b29780e384a550b1d21b982dd55845f1 (diff) | |
download | gstreamer-plugins-base-7de5af4116a7d536b9f2758951893cb82945d5be.tar.gz |
rtspconnection: Fix GError set over the top of a previous GError
The function fill_bytes could sometimes return a value greater than zero
and in the same time set the GError.
Function read_bytes calls fill_bytes in a while loop. In the special
case above it would call fill_bytes with error already set.
Thus resulting in "GError set over the top of a previous GError".
Solved this by clearing GError when return value is greater than zero.
Actions are taken depending on error type by caller of read_bytes. Eg.
with EWOULDBLOCK gst_rtsp_source_dispatch_read will try to read the
missing bytes again (GST_RTSP_EINTR )
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/445
-rw-r--r-- | gst-libs/gst/rtsp/gstrtspconnection.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index 4631a26fa..02b192cf4 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -1276,8 +1276,12 @@ fill_bytes (GstRTSPConnection * conn, guint8 * buffer, guint size, /* try to read more bytes */ r = fill_raw_bytes (conn, in, sizeof (in), block, err); if (r <= 0) { - if (out == 0) + if (out == 0) { out = r; + } else { + /* we have some data ignore error */ + g_clear_error (err); + } break; } |