Revision fd1d8d92 src/Chunkiser/input-stream.c

View differences:

src/Chunkiser/input-stream.c
1 1
#include <stdint.h>
2 2
#include <stdlib.h>
3
#include <string.h>
3 4

  
4 5
#include "chunk.h"
6
#include "config.h"
5 7
#include "chunkiser.h"
6 8
#include "chunkiser_iface.h"
7 9

  
......
12 14

  
13 15
struct input_stream *input_stream_open(const char *fname, int *period, const char *config)
14 16
{
17
  struct tag *cfg_tags;
18

  
15 19
#ifdef AVF
16 20
  in = &in_avf;
17 21
#else
18 22
  in = &in_dummy;
19 23
#endif
24
  cfg_tags = config_parse(config);
25

  
26
  if (cfg_tags) {
27
    const char *type;
28

  
29
    type = config_value_str(cfg_tags, "chunkiser");
30
    if (type && !strcmp(type, "dummy")) {
31
      in = &in_dummy;
32
    }
33
  }
20 34

  
21 35
  return in->open(fname, period, config);
22 36
}

Also available in: Unified diff