Revision 9150f42e libav/img.c

View differences:

libav/img.c
169 169
    int ret;
170 170
    ByteIOContext f1, *f;
171 171

  
172
    snprintf(filename, sizeof(filename), s->path, s->img_number);
172
    if (get_frame_filename(filename, sizeof(filename),
173
                           s->path, s->img_number) < 0)
174
        return -EIO;
173 175
    
174 176
    if (!s->is_pipe) {
175 177
        f = &f1;
......
223 225
    { 160, 128 },
224 226
    { 512, 384 },
225 227
    { 640, 352 },
228
    { 640, 240 },
226 229
};
227 230

  
228 231
static int infer_size(int *width_ptr, int *height_ptr, int size)
......
288 291
    if (!s->is_pipe) {
289 292
        /* try to find the first image */
290 293
        for(i=0;i<5;i++) {
291
            snprintf(buf, sizeof(buf), s->path, s->img_number);
294
            if (get_frame_filename(buf, sizeof(buf), s->path, s->img_number) < 0)
295
                goto fail;
292 296
            if (url_fopen(f, buf, URL_RDONLY) >= 0)
293 297
                break;
294 298
            s->img_number++;
......
543 547
        return -EIO;
544 548
    }
545 549
    
546
    snprintf(filename, sizeof(filename), img->path, img->img_number);
550
    if (get_frame_filename(filename, sizeof(filename), 
551
                           img->path, img->img_number) < 0)
552
        return -EIO;
547 553

  
548 554
    if (!img->is_pipe) {
549 555
        pb = &pb1;
......
596 602
    img_read_packet,
597 603
    img_read_close,
598 604
    NULL,
599
    AVFMT_NOFILE,
605
    AVFMT_NOFILE | AVFMT_NEEDNUMBER,
600 606
};
601 607

  
602 608
AVFormat pgmyuv_format = {
......
614 620
    img_read_packet,
615 621
    img_read_close,
616 622
    NULL,
617
    AVFMT_NOFILE,
623
    AVFMT_NOFILE | AVFMT_NEEDNUMBER,
618 624
};
619 625

  
620 626
AVFormat ppm_format = {
......
632 638
    img_read_packet,
633 639
    img_read_close,
634 640
    NULL,
635
    AVFMT_NOFILE,
641
    AVFMT_NOFILE | AVFMT_NEEDNUMBER,
636 642
};
637 643

  
638 644
AVFormat imgyuv_format = {
......
650 656
    img_read_packet,
651 657
    img_read_close,
652 658
    NULL,
653
    AVFMT_NOFILE,
659
    AVFMT_NOFILE | AVFMT_NEEDNUMBER,
654 660
};
655 661

  
656 662
AVFormat pgmpipe_format = {

Also available in: Unified diff