Revision 03de31e0 input-grapes.c

View differences:

input-grapes.c
27 27
  uint64_t first_ts;
28 28
};
29 29

  
30
struct input_desc *input_open(const char *fname, uint16_t flags, int *fds, int fds_size)
30
struct input_desc *input_open(const char *fname, int *fds, int fds_size)
31 31
{
32 32
  struct input_desc *res;
33 33
  struct timeval tv;
34
  char cfg[256];
34
  char *c;
35 35

  
36
  memset(cfg, 0, 256);
37 36
  res = malloc(sizeof(struct input_desc));
38 37
  if (res == NULL) {
39 38
    return NULL;
40 39
  }
41
  if (flags & INPUT_UDP) {
42
    sprintf(cfg, "chunkiser=udp");
43
    sprintf(cfg + strlen(cfg), ",%s", fname);
44
  } else if (flags & INPUT_IPB) {
45
    sprintf(cfg, "chunkiser=ipb,media=v");
46
  } else {
47
    sprintf(cfg, "chunkiser=avf,media=av");
48
  }
49
  if (flags & INPUT_LOOP) {
50
    sprintf(cfg + strlen(cfg), ",loop=1");
40

  
41
  c = strchr(fname,',');
42
  if (c) {
43
    *(c++) = 0;
51 44
  }
52
  res->s = input_stream_open(fname, &res->interframe, cfg);
45
  res->s = input_stream_open(fname, &res->interframe, c);
53 46
  if (res->s == NULL) {
54 47
    free(res);
55 48
    res = NULL;

Also available in: Unified diff