diff options
Diffstat (limited to 'libavformat/img2.c')
-rw-r--r-- | libavformat/img2.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/img2.c b/libavformat/img2.c index 56c4b3b567..bff06018fa 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -133,11 +133,11 @@ static int find_image_range(int *pfirst_index, int *plast_index, if (av_get_frame_filename(buf, sizeof(buf), path, first_index) < 0){ *pfirst_index = *plast_index = 1; - if(url_exist(buf)) + if (avio_check(buf, AVIO_FLAG_READ) > 0) return 0; return -1; } - if (url_exist(buf)) + if (avio_check(buf, AVIO_FLAG_READ) > 0) break; } if (first_index == 5) @@ -155,7 +155,7 @@ static int find_image_range(int *pfirst_index, int *plast_index, if (av_get_frame_filename(buf, sizeof(buf), path, last_index + range1) < 0) goto fail; - if (!url_exist(buf)) + if (avio_check(buf, AVIO_FLAG_READ) <= 0) break; range = range1; /* just in case... */ @@ -282,7 +282,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt) s->path, s->img_number)<0 && s->img_number > 1) return AVERROR(EIO); for(i=0; i<3; i++){ - if (avio_open(&f[i], filename, AVIO_RDONLY) < 0) { + if (avio_open(&f[i], filename, AVIO_FLAG_READ) < 0) { if(i==1) break; av_log(s1, AV_LOG_ERROR, "Could not open file : %s\n",filename); @@ -369,7 +369,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) return AVERROR(EIO); } for(i=0; i<3; i++){ - if (avio_open(&pb[i], filename, AVIO_WRONLY) < 0) { + if (avio_open(&pb[i], filename, AVIO_FLAG_WRITE) < 0) { av_log(s, AV_LOG_ERROR, "Could not open file : %s\n",filename); return AVERROR(EIO); } |