Revision 4bb789ed

View differences:

Chunkiser/input-avs.c
77 77
        if (res >= 0) {
78 78
            st = s->streams[pkt.stream_index];
79 79
            if (pkt.flags & PKT_FLAG_KEY) {
80
                c->data = static_buff;
81 80
                c->size = p - static_buff;
81
                c->data = malloc(c->size);
82
                if (c->data == NULL) {
83
                  return 0;
84
                }
85
                memcpy(c->data, static_buff, c->size);
86
                c->attributes_size = 0;
87
                c->attributes = NULL;
82 88
                c->id = cid++; 
83 89
                return 1;
84 90
            }
......
86 92
            p += pkt.size;
87 93
        } else {
88 94
            if (p - static_buff > 0) {
89
                c->data = static_buff;
90 95
                c->size = p - static_buff;
96
                c->data = malloc(c->size);
97
                if (c->data == NULL) {
98
                  return 0;
99
                }
100
                memcpy(c->data, static_buff, c->size);
101
                c->attributes_size = 0;
102
                c->attributes = NULL;
91 103
                c->id = cid++; 
92 104
                return 1;
93 105
            }
input-dummy.c
7 7
#include "input.h"
8 8
#include "dbg.h"
9 9

  
10
static struct input_desc {
11
} dummy_input;
12

  
10 13
struct input_desc *input_open(const char *fname)
11 14
{
12
  return NULL;
15
  return &dummy_input;
13 16
}
14 17

  
15 18
void input_close(struct input_desc *s)
streaming.c
57 57
  int res;
58 58
  struct chunk c;
59 59

  
60
  input_get(input, &c);
60
  if (input_get(input, &c) <= 0) {
61
    fprintf(stderr, "Error in input!\n");
62
    exit(-1);
63
  }
61 64
  res = cb_add_chunk(cb, &c);
62 65
  if (res < 0) {
63 66
    free(c.data);

Also available in: Unified diff