Revision 46c24e94 dumbstreamer.c

View differences:

dumbstreamer.c
7 7
#include <stdlib.h>
8 8
#include <stdint.h>
9 9
#include <stdio.h>
10
#include <stdbool.h>
10 11
#include <string.h>
11 12
#include <getopt.h>
12 13

  
......
25 26
static int multiply = 1;
26 27
static int buff_size = 8;
27 28
static const char *fname = "input.mpg";
29
static bool loop_input = false;
28 30

  
29 31
static void cmdline_parse(int argc, char *argv[])
30 32
{
31 33
  int o;
32 34

  
33
  while ((o = getopt(argc, argv, "b:c:t:p:i:P:I:f:m:")) != -1) {
35
  while ((o = getopt(argc, argv, "b:c:t:p:i:P:I:f:m:l")) != -1) {
34 36
    switch(o) {
35 37
      case 'b':
36 38
        buff_size = atoi(optarg);
......
59 61
      case 'f':
60 62
        fname = strdup(optarg);
61 63
        break;
64
      case 'l':
65
        loop_input = true;
66
        break;
62 67
      default:
63 68
        fprintf(stderr, "Error: unknown option %c\n", o);
64 69

  
......
116 121
    loop(my_sock, 1000000 / chunks_per_second, buff_size);
117 122
  }
118 123

  
119
  source_loop(fname, my_sock, period * 1000, multiply);
124
  source_loop(fname, my_sock, period * 1000, multiply, loop_input);
120 125

  
121 126
  return 0;
122 127
}

Also available in: Unified diff