]> code.delx.au - pulseaudio/blobdiff - src/tests/connect-stress.c
fix the ever-popular 'the the' typo
[pulseaudio] / src / tests / connect-stress.c
index 5476675a74bbe41506d3d18ee2847795377ec487..c4c6efcd12ca2edd1e0954a65851bc09aa9d1244 100644 (file)
@@ -107,7 +107,7 @@ static void disconnect(void) {
 static const pa_buffer_attr buffer_attr = {
     .maxlength = SAMPLE_HZ * sizeof(float) * NSTREAMS,
     .tlength = (uint32_t) -1,
-    .prebuf = 0, /* Setting prebuf to 0 guarantees us the the streams will run synchronously, no matter what */
+    .prebuf = 0, /* Setting prebuf to 0 guarantees us the streams will run synchronously, no matter what */
     .minreq = (uint32_t) -1,
     .fragsize = 0
 };
@@ -118,7 +118,7 @@ static void stream_write_callback(pa_stream *stream, size_t nbytes, void *userda
     memset(silence, 0, sizeof(silence));
 
     while (nbytes) {
-        int n = MIN(sizeof(silence), nbytes);
+        int n = PA_MIN(sizeof(silence), nbytes);
         pa_stream_write(stream, silence, n, NULL, 0, 0);
         nbytes -= n;
     }
@@ -195,9 +195,9 @@ int main(int argc, char *argv[]) {
 
     for (i = 0; i < NTESTS; i++) {
         connect(argv[0], &i);
-        usleep(random() % 500000);
+        usleep(rand() % 500000);
         disconnect();
-        usleep(random() % 500000);
+        usleep(rand() % 500000);
     }
 
     fprintf(stderr, "Done.\n");