drop most url_fileno() calls (allows to use ByteIOContext directly in caller apps instead of URLProtocol)

Originally committed as revision 4275 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Aurelien Jacobs
2005-05-19 00:06:27 +00:00
parent 3b5ffe7a39
commit a965c478b2
11 changed files with 26 additions and 16 deletions

View File

@@ -1192,7 +1192,7 @@ int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts
if(ts_max == AV_NOPTS_VALUE){
int step= 1024;
pos_max = url_filesize(url_fileno(&s->pb)) - 1;
pos_max = url_fsize(&s->pb) - 1;
do{
pos_max -= step;
ts_max = avif->read_timestamp(s, stream_index, &pos_max, pos_max + step);
@@ -1289,7 +1289,7 @@ static int av_seek_frame_byte(AVFormatContext *s, int stream_index, int64_t pos,
#endif
pos_min = s->data_offset;
pos_max = url_filesize(url_fileno(&s->pb)) - 1;
pos_max = url_fsize(&s->pb) - 1;
if (pos < pos_min) pos= pos_min;
else if(pos > pos_max) pos= pos_max;
@@ -1586,15 +1586,13 @@ static void av_estimate_timings_from_pts(AVFormatContext *ic)
static void av_estimate_timings(AVFormatContext *ic)
{
URLContext *h;
int64_t file_size;
/* get the file size, if possible */
if (ic->iformat->flags & AVFMT_NOFILE) {
file_size = 0;
} else {
h = url_fileno(&ic->pb);
file_size = url_filesize(h);
file_size = url_fsize(&ic->pb);
if (file_size < 0)
file_size = 0;
}