gst/net/gstnetclientclock.c: Fix compilation, uninitialized vars and a forgotten...
authorWim Taymans <wim.taymans@gmail.com>
Thu, 17 Nov 2005 18:18:41 +0000 (18:18 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Thu, 17 Nov 2005 18:18:41 +0000 (18:18 +0000)
Original commit message from CVS:
* gst/net/gstnetclientclock.c: (do_linear_regression),
(gst_net_client_clock_do_select), (gst_net_client_clock_thread):
Fix compilation, uninitialized vars and a forgotten continue.

ChangeLog
gst/net/gstnetclientclock.c
libs/gst/net/gstnetclientclock.c

index 25e05e1..5a842c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-11-17  Wim Taymans  <wim@fluendo.com>
+
+       * gst/net/gstnetclientclock.c: (do_linear_regression),
+       (gst_net_client_clock_do_select), (gst_net_client_clock_thread):
+       Fix compilation, uninitialized vars and a forgotten continue.
+
 2005-11-17  Andy Wingo  <wingo@pobox.com>
 
        * check/Makefile.am (check_PROGRAMS): 
index aa4c7d3..36ce93c 100644 (file)
@@ -227,6 +227,8 @@ do_linear_regression (GstClockTime * x, GstClockTime * y, gint n, gdouble * m,
   gdouble sxx, syy, sxy, xbar, ybar;
   gint i;
 
+  sxx = syy = sxy = xbar = ybar = 0.0;
+
   /* we lose precision with the doubles, but there's no other way except to use
      ~80 bit arithmetic */
   for (i = 0; i < n; i++) {
@@ -307,7 +309,7 @@ bogus_observation:
 static gint
 gst_net_client_clock_do_select (GstNetClientClock * self, fd_set * readfds)
 {
-  guint max_sock;
+  gint max_sock;
   gint ret;
 
   while (TRUE) {
@@ -319,12 +321,12 @@ gst_net_client_clock_do_select (GstNetClientClock * self, fd_set * readfds)
     GST_LOG_OBJECT (self, "doing select");
     {
       GstClockTime diff;
-      GTimeVal tv;
+      GTimeVal tv, *ptv = &tv;
 
       diff = gst_clock_get_internal_time (GST_CLOCK (self));
       GST_TIME_TO_TIMEVAL (self->current_timeout, tv);
 
-      ret = select (max_sock + 1, readfds, NULL, NULL, (struct timeval *) &tv);
+      ret = select (max_sock + 1, readfds, NULL, NULL, (struct timeval *) ptv);
 
       diff = gst_clock_get_internal_time (GST_CLOCK (self)) - diff;
 
@@ -412,6 +414,7 @@ gst_net_client_clock_thread (gpointer data)
 
       /* reset timeout */
       self->current_timeout = self->timeout;
+      continue;
     } else if (FD_ISSET (READ_SOCKET (self), &read_fds)) {
       /* got data in */
       GstClockTime new_local = gst_clock_get_internal_time (GST_CLOCK (self));
index aa4c7d3..36ce93c 100644 (file)
@@ -227,6 +227,8 @@ do_linear_regression (GstClockTime * x, GstClockTime * y, gint n, gdouble * m,
   gdouble sxx, syy, sxy, xbar, ybar;
   gint i;
 
+  sxx = syy = sxy = xbar = ybar = 0.0;
+
   /* we lose precision with the doubles, but there's no other way except to use
      ~80 bit arithmetic */
   for (i = 0; i < n; i++) {
@@ -307,7 +309,7 @@ bogus_observation:
 static gint
 gst_net_client_clock_do_select (GstNetClientClock * self, fd_set * readfds)
 {
-  guint max_sock;
+  gint max_sock;
   gint ret;
 
   while (TRUE) {
@@ -319,12 +321,12 @@ gst_net_client_clock_do_select (GstNetClientClock * self, fd_set * readfds)
     GST_LOG_OBJECT (self, "doing select");
     {
       GstClockTime diff;
-      GTimeVal tv;
+      GTimeVal tv, *ptv = &tv;
 
       diff = gst_clock_get_internal_time (GST_CLOCK (self));
       GST_TIME_TO_TIMEVAL (self->current_timeout, tv);
 
-      ret = select (max_sock + 1, readfds, NULL, NULL, (struct timeval *) &tv);
+      ret = select (max_sock + 1, readfds, NULL, NULL, (struct timeval *) ptv);
 
       diff = gst_clock_get_internal_time (GST_CLOCK (self)) - diff;
 
@@ -412,6 +414,7 @@ gst_net_client_clock_thread (gpointer data)
 
       /* reset timeout */
       self->current_timeout = self->timeout;
+      continue;
     } else if (FD_ISSET (READ_SOCKET (self), &read_fds)) {
       /* got data in */
       GstClockTime new_local = gst_clock_get_internal_time (GST_CLOCK (self));