projects
/
platform
/
upstream
/
gstreamer.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into 0.11
[platform/upstream/gstreamer.git]
/
gst
/
tcp
/
gstmultifdsink.c
diff --git
a/gst/tcp/gstmultifdsink.c
b/gst/tcp/gstmultifdsink.c
index
6ef10eb
..
51c36e4
100644
(file)
--- a/
gst/tcp/gstmultifdsink.c
+++ b/
gst/tcp/gstmultifdsink.c
@@
-812,7
+812,7
@@
gst_multi_fd_sink_add_full (GstMultiFdSink * sink, int fd,
GstTCPClient *client;
GList *clink;
GTimeVal now;
GstTCPClient *client;
GList *clink;
GTimeVal now;
- gint flags
, res
;
+ gint flags;
struct stat statbuf;
GST_DEBUG_OBJECT (sink, "[fd %5d] adding client, sync_method %d, "
struct stat statbuf;
GST_DEBUG_OBJECT (sink, "[fd %5d] adding client, sync_method %d, "
@@
-867,7
+867,11
@@
gst_multi_fd_sink_add_full (GstMultiFdSink * sink, int fd,
sink->clients_cookie++;
/* set the socket to non blocking */
sink->clients_cookie++;
/* set the socket to non blocking */
- res = fcntl (fd, F_SETFL, O_NONBLOCK);
+ if (fcntl (fd, F_SETFL, O_NONBLOCK) < 0) {
+ GST_ERROR_OBJECT (sink, "failed to make socket %d non-blocking: %s", fd,
+ g_strerror (errno));
+ }
+
/* we always read from a client */
gst_poll_add_fd (sink->fdset, &client->fd);
/* we always read from a client */
gst_poll_add_fd (sink->fdset, &client->fd);
@@
-879,8
+883,7
@@
gst_multi_fd_sink_add_full (GstMultiFdSink * sink, int fd,
}
}
/* figure out the mode, can't use send() for non sockets */
}
}
/* figure out the mode, can't use send() for non sockets */
- res = fstat (fd, &statbuf);
- if (S_ISSOCK (statbuf.st_mode)) {
+ if (fstat (fd, &statbuf) == 0 && S_ISSOCK (statbuf.st_mode)) {
client->is_socket = TRUE;
setup_dscp_client (sink, client);
}
client->is_socket = TRUE;
setup_dscp_client (sink, client);
}
@@
-1775,7
+1778,6
@@
gst_multi_fd_sink_new_client (GstMultiFdSink * sink, GstTCPClient * client)
}
case GST_SYNC_METHOD_BURST_KEYFRAME:
{
}
case GST_SYNC_METHOD_BURST_KEYFRAME:
{
- gboolean ok;
gint min_idx, max_idx;
gint next_syncframe, prev_syncframe;
gint min_idx, max_idx;
gint next_syncframe, prev_syncframe;
@@
-1787,7
+1789,7
@@
gst_multi_fd_sink_new_client (GstMultiFdSink * sink, GstTCPClient * client)
* NEXT_KEYFRAME.
*/
/* gather burst limits */
* NEXT_KEYFRAME.
*/
/* gather burst limits */
-
ok =
count_burst_unit (sink, &min_idx, client->burst_min_unit,
+ count_burst_unit (sink, &min_idx, client->burst_min_unit,
client->burst_min_value, &max_idx, client->burst_max_unit,
client->burst_max_value);
client->burst_min_value, &max_idx, client->burst_max_unit,
client->burst_max_value);
@@
-1824,7
+1826,6
@@
gst_multi_fd_sink_new_client (GstMultiFdSink * sink, GstTCPClient * client)
}
case GST_SYNC_METHOD_BURST_WITH_KEYFRAME:
{
}
case GST_SYNC_METHOD_BURST_WITH_KEYFRAME:
{
- gboolean ok;
gint min_idx, max_idx;
gint next_syncframe;
gint min_idx, max_idx;
gint next_syncframe;
@@
-1835,7
+1836,7
@@
gst_multi_fd_sink_new_client (GstMultiFdSink * sink, GstTCPClient * client)
* amount of data up 'till min.
*/
/* gather enough data to burst */
* amount of data up 'till min.
*/
/* gather enough data to burst */
-
ok =
count_burst_unit (sink, &min_idx, client->burst_min_unit,
+ count_burst_unit (sink, &min_idx, client->burst_min_unit,
client->burst_min_value, &max_idx, client->burst_max_unit,
client->burst_max_value);
client->burst_min_value, &max_idx, client->burst_max_unit,
client->burst_max_value);