Revision ebb92e07 libavformat/img2.c

View differences:

libavformat/img2.c
269 269
                                  s->path, s->img_number)<0 && s->img_number > 1)
270 270
            return AVERROR(EIO);
271 271
        for(i=0; i<3; i++){
272
            if (url_fopen(&f[i], filename, URL_RDONLY) < 0) {
272
            if (avio_open(&f[i], filename, URL_RDONLY) < 0) {
273 273
                if(i==1)
274 274
                    break;
275 275
                av_log(s1, AV_LOG_ERROR, "Could not open file : %s\n",filename);
......
300 300
        if(size[i]){
301 301
            ret[i]= avio_read(f[i], pkt->data + pkt->size, size[i]);
302 302
            if (!s->is_pipe)
303
                url_fclose(f[i]);
303
                avio_close(f[i]);
304 304
            if(ret[i]>0)
305 305
                pkt->size += ret[i];
306 306
        }
......
353 353
            return AVERROR(EIO);
354 354
        }
355 355
        for(i=0; i<3; i++){
356
            if (url_fopen(&pb[i], filename, URL_WRONLY) < 0) {
356
            if (avio_open(&pb[i], filename, URL_WRONLY) < 0) {
357 357
                av_log(s, AV_LOG_ERROR, "Could not open file : %s\n",filename);
358 358
                return AVERROR(EIO);
359 359
            }
......
373 373
        avio_write(pb[2], pkt->data + ysize +(pkt->size - ysize)/2, (pkt->size - ysize)/2);
374 374
        put_flush_packet(pb[1]);
375 375
        put_flush_packet(pb[2]);
376
        url_fclose(pb[1]);
377
        url_fclose(pb[2]);
376
        avio_close(pb[1]);
377
        avio_close(pb[2]);
378 378
    }else{
379 379
        if(av_str2id(img_tags, s->filename) == CODEC_ID_JPEG2000){
380 380
            AVStream *st = s->streams[0];
......
403 403
    }
404 404
    put_flush_packet(pb[0]);
405 405
    if (!img->is_pipe) {
406
        url_fclose(pb[0]);
406
        avio_close(pb[0]);
407 407
    }
408 408

  
409 409
    img->img_number++;

Also available in: Unified diff