]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Fixed handling of some command line arguments witout respoect of their position.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 25 Jan 2008 10:26:41 +0000 (11:26 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 25 Jan 2008 10:26:41 +0000 (11:26 +0100)
wme_test/wclient.c

index ab50ad8917aee26ee3f604999d27dd2441b9d0e8..19f7c8175071728d5b76aa075661fc7f8c5f149a 100644 (file)
@@ -526,6 +526,11 @@ calc_stream_params(struct stream *stream)
        int bandwidth;
        struct hostent* ph;
 
+       /* If some parameters are not set explicitely, use default values. */
+       if (stream->bandwidth_bps < 0) stream->bandwidth_bps = opt_def_bandwidth;
+       if (stream->packet_size < 0) stream->packet_size = opt_packet_size;
+       if (stream->period_usec < 0) stream->period_usec = opt_def_period_msec;
+
        bandwidth = stream->bandwidth_bps;
 
        /* Avoid arithmetic exception. Server thread will exit if
@@ -607,7 +612,7 @@ char* parse_bandwidths(char *params)
                                return params;
                        params = next_char;
                } else
-                       bw = opt_def_bandwidth;
+                       bw = -1;
                
                sp->bandwidth_bps = bw*Kbit;
 
@@ -628,8 +633,8 @@ char* parse_bandwidths(char *params)
                                        return params;
                                params = next_char;
                        } else {
-                               packet_size = opt_packet_size;
-                               period = opt_def_period_msec;
+                               packet_size = -1; 
+                               period = -1;
                        }
                }
                sp->period_usec = period*MSEC_TO_USEC;