Revision 491ea146

View differences:

Cutter/input-avs.c
181 181

  
182 182
    return 0;
183 183
}
184

  
185
int chunk_read_avs2(void *s_h, struct chunk *c)
186
{
187
    AVFormatContext *s = s_h;
188
    static AVPacket pkt;
189
    int res;
190
    static uint8_t static_buff[STATIC_BUFF_SIZE];
191

  
192
    res = av_read_frame(s, &pkt);
193
    if (res >= 0) {
194
      memcpy(static_buff, pkt.data, pkt.size);
195
      c->frame[0] = static_buff;
196
      c->frame_len[0] = pkt.size;
197
      c->stride_size = 1;
198
      return 1;
199
    }
200

  
201
    return 0;
202
}
203

  
204

  
Cutter/input-avs.h
2 2
void close_input_stream_avs(void *s);
3 3
int chunk_read_avs(void *s_h, struct chunk *c);
4 4
int chunk_read_avs1(void *s_h, struct chunk *c);
5
int chunk_read_avs2(void *s_h, struct chunk *c);
Cutter/input.c
95 95
#ifdef AVS
96 96
    if (chunk_size == 0) {
97 97
        s->read = chunk_read_avs;
98
    } else {
98
    } else if (chunk_size == -1) {
99 99
        s->read = chunk_read_avs1;
100
    } else {
101
        s->read = chunk_read_avs2;
100 102
    }
101 103
    s->close = close_input_stream_avs;
102 104
    s->ctx = input_stream_open_avs(fname, chunk_size);

Also available in: Unified diff