Revision 52976315

View differences:

Chunkiser/input-stream-avs.c
74 74
    free(s);
75 75
}
76 76

  
77
void input_stream_rewind(struct input_stream *s)
77
int input_stream_rewind(struct input_stream *s)
78 78
{
79
    av_seek_frame(s->s,-1,0,0);
79
    int ret;
80

  
81
    ret = av_seek_frame(s->s,-1,0,0);
80 82
    s->base_ts = s->last_ts;
83

  
84
    return ret;
81 85
}
82 86

  
83 87

  
......
158 162

  
159 163
    res = av_read_frame(s->s, &pkt);
160 164
    if (res < 0) {
161
      input_stream_rewind(s);
165
      if (input_stream_rewind(s) < 0) {
166
        fprintf(stderr, "AVPacket read failed: %d!!!\n", res);
167
        *size = -1;
168

  
169
        return NULL;
170
      }
162 171
      *size = 0;
163 172
      *ts = s->last_ts;
164
      //fprintf(stderr, "AVPacket read failed: %d!!!\n", res);
165
      //*size = -1;
166 173

  
167 174
      return NULL;
168 175
    }

Also available in: Unified diff