GNOME Bugzilla – Bug 358156
in udpsrc.c gst_udpsrc_create function read command could loop
Last modified: 2006-09-29 08:11:26 UTC
The problem was that to check if there was any command left of the pipe the result of the read was compared with < 0 when read can return 0 and have no more data (-1 is an error) See from the man : " If count is zero, read() returns zero and has no other results." ... " On success, the number of bytes read is returned (zero indicates end of file " So I modifded the READ_COMMAND (udpsrc, command, res); if (res < 0) { GST_LOG_OBJECT (udpsrc, "no more commands"); /* no more commands */ break; } with a res <= 0
Created attachment 73572 [details] [review] Path to fix the loop problem
Indeed, thanks! There are a few other elements where a similar piece of code is equally wrong. Patch by: Antoine Tremblay <hexa00 at gmail dot com> * gst/udp/gstudpsrc.c: (gst_udpsrc_create): Fix possible infinite loop when shutting down, a read can also return 0 to indicate no more messages are available. Fixes #358156.