mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-25 16:48:11 +00:00
gst/udp/gstudpsrc.c: When the socket is used by the app for other purposes, don't generate an error if there is activ...
Original commit message from CVS: Based on patch by: Laurent Glayal <spglegle yahoo fr> * gst/udp/gstudpsrc.c: (gst_udpsrc_create): When the socket is used by the app for other purposes, don't generate an error if there is activaty on the socket that is not data related. Fixes #487488.
This commit is contained in:
parent
279fe5fac6
commit
961c985270
2 changed files with 15 additions and 8 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2007-10-18 Wim Taymans <wim.taymans@gmail.com>
|
||||||
|
|
||||||
|
Based on patch by: Laurent Glayal <spglegle yahoo fr>
|
||||||
|
|
||||||
|
* gst/udp/gstudpsrc.c: (gst_udpsrc_create):
|
||||||
|
When the socket is used by the app for other purposes, don't generate an
|
||||||
|
error if there is activaty on the socket that is not data related.
|
||||||
|
Fixes #487488.
|
||||||
|
|
||||||
2007-10-18 Wim Taymans <wim.taymans@gmail.com>
|
2007-10-18 Wim Taymans <wim.taymans@gmail.com>
|
||||||
|
|
||||||
* sys/v4l2/v4l2src_calls.c: (gst_v4l2_buffer_finalize),
|
* sys/v4l2/v4l2src_calls.c: (gst_v4l2_buffer_finalize),
|
||||||
|
|
|
@ -377,6 +377,7 @@ gst_udpsrc_create (GstPushSrc * psrc, GstBuffer ** buf)
|
||||||
|
|
||||||
udpsrc = GST_UDPSRC (psrc);
|
udpsrc = GST_UDPSRC (psrc);
|
||||||
|
|
||||||
|
retry:
|
||||||
/* quick check, avoid going in select when we already have data */
|
/* quick check, avoid going in select when we already have data */
|
||||||
readsize = 0;
|
readsize = 0;
|
||||||
if ((ret = IOCTL_SOCKET (udpsrc->sock, FIONREAD, &readsize)) < 0)
|
if ((ret = IOCTL_SOCKET (udpsrc->sock, FIONREAD, &readsize)) < 0)
|
||||||
|
@ -450,8 +451,12 @@ gst_udpsrc_create (GstPushSrc * psrc, GstBuffer ** buf)
|
||||||
if ((ret = IOCTL_SOCKET (udpsrc->sock, FIONREAD, &readsize)) < 0)
|
if ((ret = IOCTL_SOCKET (udpsrc->sock, FIONREAD, &readsize)) < 0)
|
||||||
goto ioctl_failed;
|
goto ioctl_failed;
|
||||||
|
|
||||||
|
/* if we get here and there is nothing to read from the socket, the select got
|
||||||
|
* woken up by activity on the socket but it was not a read. We how someone
|
||||||
|
* will also do something with the socket so that we don't go into an infinite
|
||||||
|
* loop in the select(). */
|
||||||
if (!readsize)
|
if (!readsize)
|
||||||
goto nothing_to_read;
|
goto retry;
|
||||||
|
|
||||||
no_select:
|
no_select:
|
||||||
GST_LOG_OBJECT (udpsrc, "ioctl says %d bytes available", (int) readsize);
|
GST_LOG_OBJECT (udpsrc, "ioctl says %d bytes available", (int) readsize);
|
||||||
|
@ -514,13 +519,6 @@ ioctl_failed:
|
||||||
("ioctl failed %d: %s (%d)", ret, g_strerror (errno), errno));
|
("ioctl failed %d: %s (%d)", ret, g_strerror (errno), errno));
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
nothing_to_read:
|
|
||||||
{
|
|
||||||
GST_ELEMENT_ERROR (udpsrc, RESOURCE, READ, (NULL),
|
|
||||||
("ioctl returned readsize 0 %d: %s (%d)", ret, g_strerror (errno),
|
|
||||||
errno));
|
|
||||||
return GST_FLOW_ERROR;
|
|
||||||
}
|
|
||||||
receive_error:
|
receive_error:
|
||||||
{
|
{
|
||||||
g_free (pktdata);
|
g_free (pktdata);
|
||||||
|
|
Loading…
Reference in a new issue