From 021fe7b524d999d18065b679bfa3c658bbdc3a0a Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 25 Jan 2008 11:26:41 +0100 Subject: [PATCH] Fixed handling of some command line arguments witout respoect of their position. --- wme_test/wclient.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/wme_test/wclient.c b/wme_test/wclient.c index ab50ad8..19f7c81 100644 --- a/wme_test/wclient.c +++ b/wme_test/wclient.c @@ -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; -- 2.39.2