Revision 9150f42e libav/jpeg.c

View differences:

libav/jpeg.c
1 1
/*
2
 * Miscellaneous MJPEG based formats
3
 * Copyright (c) 2000 Gerard Lantau.
2
 * JPEG based formats
3
 * Copyright (c) 2000, 2001 Gerard Lantau.
4 4
 *
5 5
 * This program is free software; you can redistribute it and/or modify
6 6
 * it under the terms of the GNU General Public License as published by
......
126 126
    char filename[1024];
127 127
    ByteIOContext f1, *pb = &f1;
128 128

  
129
    snprintf(filename, sizeof(filename), s->path, s->img_number);
129
    if (get_frame_filename(filename, sizeof(filename), 
130
                           s->path, s->img_number) < 0)
131
        return -EIO;
130 132
    if (url_fopen(pb, filename, URL_WRONLY) < 0)
131 133
        return -EIO;
132 134

  
......
173 175

  
174 176
    /* try to find the first image */
175 177
    for(i=0;i<5;i++) {
176
        snprintf(buf, sizeof(buf), s->path, s->img_number);
178
        if (get_frame_filename(buf, sizeof(buf), s->path, s->img_number) < 0)
179
            goto fail;
177 180
        if (url_fopen(f, buf, URL_RDONLY) >= 0)
178 181
            break;
179 182
        s->img_number++;
......
201 204
    int size;
202 205
    ByteIOContext f1, *f = &f1;
203 206

  
204
    snprintf(filename, sizeof(filename), s->path, s->img_number);
207
    if (get_frame_filename(filename, sizeof(filename), 
208
                           s->path, s->img_number) < 0)
209
        return -EIO;
205 210
    
206 211
    f = &f1;
207 212
    if (url_fopen(f, filename, URL_RDONLY) < 0)
......
241 246
    jpeg_read_packet,
242 247
    jpeg_read_close,
243 248
    NULL,
244
    AVFMT_NOFILE,
249
    AVFMT_NOFILE | AVFMT_NEEDNUMBER,
245 250
};

Also available in: Unified diff