Browse Source

avio: avio_ prefix for url_fsize

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Anton Khirnov 14 years ago
parent
commit
76aa876e69
10 changed files with 19 additions and 14 deletions
  1. 2 2
      ffmpeg.c
  2. 1 1
      ffplay.c
  3. 1 1
      libavformat/apetag.c
  4. 4 4
      libavformat/avidec.c
  5. 2 1
      libavformat/avio.h
  6. 5 1
      libavformat/aviobuf.c
  7. 1 1
      libavformat/cafdec.c
  8. 1 1
      libavformat/cdg.c
  9. 1 1
      libavformat/dv.c
  10. 1 1
      libavformat/ffmdec.c

+ 2 - 2
ffmpeg.c

@@ -1350,8 +1350,8 @@ static void print_report(AVFormatContext **output_files,
 
     oc = output_files[0];
 
-    total_size = url_fsize(oc->pb);
-    if(total_size<0) // FIXME improve url_fsize() so it works with non seekable output too
+    total_size = avio_size(oc->pb);
+    if(total_size<0) // FIXME improve avio_size() so it works with non seekable output too
         total_size= avio_tell(oc->pb);
 
     buf[0] = '\0';

+ 1 - 1
ffplay.c

@@ -2838,7 +2838,7 @@ static void event_loop(void)
             }
             if (cur_stream) {
                 if(seek_by_bytes || cur_stream->ic->duration<=0){
-                    uint64_t size=  url_fsize(cur_stream->ic->pb);
+                    uint64_t size=  avio_size(cur_stream->ic->pb);
                     stream_seek(cur_stream, size*x/cur_stream->width, 0, 1);
                 }else{
                     int64_t ts;

+ 1 - 1
libavformat/apetag.c

@@ -66,7 +66,7 @@ static int ape_tag_read_field(AVFormatContext *s)
 void ff_ape_parse_tag(AVFormatContext *s)
 {
     AVIOContext *pb = s->pb;
-    int file_size = url_fsize(pb);
+    int file_size = avio_size(pb);
     uint32_t val, fields, tag_bytes;
     uint8_t buf[8];
     int i;

+ 4 - 4
libavformat/avidec.c

@@ -138,7 +138,7 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){
     AVIStream *ast;
     int i;
     int64_t last_pos= -1;
-    int64_t filesize= url_fsize(s->pb);
+    int64_t filesize= avio_size(s->pb);
 
 #ifdef DEBUG_SEEK
     av_log(s, AV_LOG_ERROR, "longs_pre_entry:%d index_type:%d entries_in_use:%d chunk_id:%X base:%16"PRIX64"\n",
@@ -351,7 +351,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
     if (get_riff(s, pb) < 0)
         return -1;
 
-    avi->fsize = url_fsize(pb);
+    avi->fsize = avio_size(pb);
     if(avi->fsize<=0)
         avi->fsize= avi->riff_end == 8 ? INT64_MAX : avi->riff_end;
 
@@ -378,7 +378,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
             if (tag1 == MKTAG('m', 'o', 'v', 'i')) {
                 avi->movi_list = avio_tell(pb) - 4;
                 if(size) avi->movi_end = avi->movi_list + size + (size & 1);
-                else     avi->movi_end = url_fsize(pb);
+                else     avi->movi_end = avio_size(pb);
                 av_dlog(NULL, "movi end=%"PRIx64"\n", avi->movi_end);
                 goto end_of_header;
             }
@@ -705,7 +705,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
                 av_log(s, AV_LOG_ERROR, "Something went wrong during header parsing, "
                                         "I will ignore it and try to continue anyway.\n");
                 avi->movi_list = avio_tell(pb) - 4;
-                avi->movi_end  = url_fsize(pb);
+                avi->movi_end  = avio_size(pb);
                 goto end_of_header;
             }
             /* skip tag */

+ 2 - 1
libavformat/avio.h

@@ -426,6 +426,7 @@ attribute_deprecated int url_fclose(AVIOContext *s);
 attribute_deprecated int64_t url_fseek(AVIOContext *s, int64_t offset, int whence);
 attribute_deprecated int url_fskip(AVIOContext *s, int64_t offset);
 attribute_deprecated int64_t url_ftell(AVIOContext *s);
+attribute_deprecated int64_t url_fsize(AVIOContext *s);
 #define URL_EOF (-1)
 attribute_deprecated int url_fgetc(AVIOContext *s);
 /**
@@ -491,7 +492,7 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
  * Get the filesize.
  * @return filesize or AVERROR
  */
-int64_t url_fsize(AVIOContext *s);
+int64_t avio_size(AVIOContext *s);
 
 /**
  * feof() equivalent for AVIOContext.

+ 5 - 1
libavformat/aviobuf.c

@@ -246,7 +246,7 @@ int64_t url_ftell(AVIOContext *s)
 }
 #endif
 
-int64_t url_fsize(AVIOContext *s)
+int64_t avio_size(AVIOContext *s)
 {
     int64_t size;
 
@@ -371,6 +371,10 @@ int64_t url_fseek(AVIOContext *s, int64_t offset, int whence)
 {
     return avio_seek(s, offset, whence);
 }
+int64_t url_fsize(AVIOContext *s)
+{
+    return avio_size(s);
+}
 #endif
 
 int avio_put_str(AVIOContext *s, const char *str)

+ 1 - 1
libavformat/cafdec.c

@@ -284,7 +284,7 @@ static int read_header(AVFormatContext *s,
                                 "block size or frame size are variable.\n");
         return AVERROR_INVALIDDATA;
     }
-    s->file_size = url_fsize(pb);
+    s->file_size = avio_size(pb);
     s->file_size = FFMAX(0, s->file_size);
 
     av_set_pts_info(st, 64, 1, st->codec->sample_rate);

+ 1 - 1
libavformat/cdg.c

@@ -38,7 +38,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
     /// 75 sectors/sec * 4 packets/sector = 300 packets/sec
     av_set_pts_info(vst, 32, 1, 300);
 
-    ret = url_fsize(s->pb);
+    ret = avio_size(s->pb);
     if (ret > 0)
         vst->duration = (ret * vst->time_base.den) / (CDG_PACKET_SIZE * 300);
 

+ 1 - 1
libavformat/dv.c

@@ -370,7 +370,7 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
     // FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)
     const DVprofile* sys = ff_dv_codec_profile(c->vst->codec);
     int64_t offset;
-    int64_t size = url_fsize(s->pb) - s->data_offset;
+    int64_t size = avio_size(s->pb) - s->data_offset;
     int64_t max_offset = ((size-1) / sys->frame_size) * sys->frame_size;
 
     offset = sys->frame_size * timestamp;

+ 1 - 1
libavformat/ffmdec.c

@@ -282,7 +282,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
     ffm->write_index = avio_rb64(pb);
     /* get also filesize */
     if (!url_is_streamed(pb)) {
-        ffm->file_size = url_fsize(pb);
+        ffm->file_size = avio_size(pb);
         if (ffm->write_index)
             adjust_write_index(s);
     } else {

Some files were not shown because too many files changed in this diff