Browse Source

avio: avio_ prefix for url_fseek

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Anton Khirnov 14 years ago
parent
commit
6b4aa5dac8

+ 3 - 3
libavformat/4xm.c

@@ -106,7 +106,7 @@ static int fourxm_read_header(AVFormatContext *s,
     fourxm->fps = 1.0;
 
     /* skip the first 3 32-bit numbers */
-    url_fseek(pb, 12, SEEK_CUR);
+    avio_seek(pb, 12, SEEK_CUR);
 
     /* check for LIST-HEAD */
     GET_LIST_HEADER();
@@ -322,12 +322,12 @@ static int fourxm_read_packet(AVFormatContext *s,
                 fourxm->tracks[track_number].audio_pts += audio_frame_count;
 
             } else {
-                url_fseek(pb, size, SEEK_CUR);
+                avio_seek(pb, size, SEEK_CUR);
             }
             break;
 
         default:
-            url_fseek(pb, size, SEEK_CUR);
+            avio_seek(pb, size, SEEK_CUR);
             break;
         }
     }

+ 2 - 2
libavformat/aiffdec.c

@@ -152,7 +152,7 @@ static unsigned int get_aiff_header(AVIOContext *pb, AVCodecContext *codec,
 
     /* Chunk is over */
     if (size)
-        url_fseek(pb, size, SEEK_CUR);
+        avio_seek(pb, size, SEEK_CUR);
 
     return num_frames;
 }
@@ -276,7 +276,7 @@ got_sound:
         st->nb_frames * st->codec->frame_size : st->nb_frames;
 
     /* Position the stream at the first block */
-    url_fseek(pb, offset, SEEK_SET);
+    avio_seek(pb, offset, SEEK_SET);
 
     return 0;
 }

+ 4 - 4
libavformat/aiffenc.c

@@ -126,19 +126,19 @@ static int aiff_write_trailer(AVFormatContext *s)
 
     if (!url_is_streamed(s->pb)) {
         /* File length */
-        url_fseek(pb, aiff->form, SEEK_SET);
+        avio_seek(pb, aiff->form, SEEK_SET);
         avio_wb32(pb, file_size - aiff->form - 4);
 
         /* Number of sample frames */
-        url_fseek(pb, aiff->frames, SEEK_SET);
+        avio_seek(pb, aiff->frames, SEEK_SET);
         avio_wb32(pb, (file_size-aiff->ssnd-12)/enc->block_align);
 
         /* Sound Data chunk size */
-        url_fseek(pb, aiff->ssnd, SEEK_SET);
+        avio_seek(pb, aiff->ssnd, SEEK_SET);
         avio_wb32(pb, file_size - aiff->ssnd - 4);
 
         /* return to the end */
-        url_fseek(pb, end_size, SEEK_SET);
+        avio_seek(pb, end_size, SEEK_SET);
 
         put_flush_packet(pb);
     }

+ 4 - 4
libavformat/anm.c

@@ -143,7 +143,7 @@ static int read_header(AVFormatContext *s,
         goto close_and_return;
 
     /* read page table */
-    ret = url_fseek(pb, anm->page_table_offset, SEEK_SET);
+    ret = avio_seek(pb, anm->page_table_offset, SEEK_SET);
     if (ret < 0)
         goto close_and_return;
 
@@ -192,7 +192,7 @@ repeat:
 
     /* parse page header */
     if (anm->record < 0) {
-        url_fseek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16), SEEK_SET);
+        avio_seek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16), SEEK_SET);
         url_fskip(pb, 8 + 2*p->nb_records);
         anm->record = 0;
     }
@@ -209,10 +209,10 @@ repeat:
 
     /* fetch record size */
     tmp = url_ftell(pb);
-    url_fseek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16) +
+    avio_seek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16) +
               8 + anm->record * 2, SEEK_SET);
     record_size = avio_rl16(pb);
-    url_fseek(pb, tmp, SEEK_SET);
+    avio_seek(pb, tmp, SEEK_SET);
 
     /* fetch record */
     pkt->size = av_get_packet(s->pb, pkt, record_size);

+ 4 - 4
libavformat/ape.c

@@ -187,7 +187,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
         /* Skip any unknown bytes at the end of the descriptor.
            This is for future compatibility */
         if (ape->descriptorlength > 52)
-            url_fseek(pb, ape->descriptorlength - 52, SEEK_CUR);
+            avio_seek(pb, ape->descriptorlength - 52, SEEK_CUR);
 
         /* Read header data */
         ape->compressiontype      = avio_rl16(pb);
@@ -212,7 +212,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
         ape->finalframeblocks     = avio_rl32(pb);
 
         if (ape->formatflags & MAC_FORMAT_FLAG_HAS_PEAK_LEVEL) {
-            url_fseek(pb, 4, SEEK_CUR); /* Skip the peak level */
+            avio_seek(pb, 4, SEEK_CUR); /* Skip the peak level */
             ape->headerlength += 4;
         }
 
@@ -289,7 +289,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
     /* try to read APE tags */
     if (!url_is_streamed(pb)) {
         ff_ape_parse_tag(s);
-        url_fseek(pb, 0, SEEK_SET);
+        avio_seek(pb, 0, SEEK_SET);
     }
 
     av_log(s, AV_LOG_DEBUG, "Decoding file - v%d.%02d, compression level %d\n", ape->fileversion / 1000, (ape->fileversion % 1000) / 10, ape->compressiontype);
@@ -342,7 +342,7 @@ static int ape_read_packet(AVFormatContext * s, AVPacket * pkt)
     if (ape->currentframe > ape->totalframes)
         return AVERROR(EIO);
 
-    url_fseek (s->pb, ape->frames[ape->currentframe].pos, SEEK_SET);
+    avio_seek (s->pb, ape->frames[ape->currentframe].pos, SEEK_SET);
 
     /* Calculate how many blocks there are in this frame */
     if (ape->currentframe == (ape->totalframes - 1))

+ 2 - 2
libavformat/apetag.c

@@ -74,7 +74,7 @@ void ff_ape_parse_tag(AVFormatContext *s)
     if (file_size < APE_TAG_FOOTER_BYTES)
         return;
 
-    url_fseek(pb, file_size - APE_TAG_FOOTER_BYTES, SEEK_SET);
+    avio_seek(pb, file_size - APE_TAG_FOOTER_BYTES, SEEK_SET);
 
     avio_read(pb, buf, 8);     /* APETAGEX */
     if (strncmp(buf, "APETAGEX", 8)) {
@@ -105,7 +105,7 @@ void ff_ape_parse_tag(AVFormatContext *s)
         return;
     }
 
-    url_fseek(pb, file_size - tag_bytes, SEEK_SET);
+    avio_seek(pb, file_size - tag_bytes, SEEK_SET);
 
     for (i=0; i<fields; i++)
         if (ape_tag_read_field(s) < 0) break;

+ 12 - 12
libavformat/asfdec.c

@@ -182,7 +182,7 @@ static void get_tag(AVFormatContext *s, const char *key, int type, int len)
         av_metadata_set2(&s->metadata, key, value, 0);
 finish:
     av_freep(&value);
-    url_fseek(s->pb, off + len, SEEK_SET);
+    avio_seek(s->pb, off + len, SEEK_SET);
 }
 
 static int asf_read_file_properties(AVFormatContext *s, int64_t size)
@@ -428,14 +428,14 @@ static int asf_read_ext_stream_properties(AVFormatContext *s, int64_t size)
     for (i=0; i<stream_ct; i++){
         avio_rl16(pb);
         ext_len = avio_rl16(pb);
-        url_fseek(pb, ext_len, SEEK_CUR);
+        avio_seek(pb, ext_len, SEEK_CUR);
     }
 
     for (i=0; i<payload_ext_ct; i++){
         ff_get_guid(pb, &g);
         ext_d=avio_rl16(pb);
         ext_len=avio_rl32(pb);
-        url_fseek(pb, ext_len, SEEK_CUR);
+        avio_seek(pb, ext_len, SEEK_CUR);
     }
 
     return 0;
@@ -654,7 +654,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
         }
         if(url_ftell(pb) != gpos + gsize)
             av_log(s, AV_LOG_DEBUG, "gpos mismatch our pos=%"PRIu64", end=%"PRIu64"\n", url_ftell(pb)-gpos, gsize);
-        url_fseek(pb, gpos + gsize, SEEK_SET);
+        avio_seek(pb, gpos + gsize, SEEK_SET);
     }
     ff_get_guid(pb, &g);
     avio_rl64(pb);
@@ -758,7 +758,7 @@ static int ff_asf_get_packet(AVFormatContext *s, AVIOContext *pb)
         d= avio_r8(pb);
         rsize+=3;
     }else{
-        url_fseek(pb, -1, SEEK_CUR); //FIXME
+        avio_seek(pb, -1, SEEK_CUR); //FIXME
     }
 
     asf->packet_flags    = c;
@@ -1146,7 +1146,7 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos,
     if (s->packet_size > 0)
         pos= (pos+s->packet_size-1-s->data_offset)/s->packet_size*s->packet_size+ s->data_offset;
     *ppos= pos;
-    url_fseek(s->pb, pos, SEEK_SET);
+    avio_seek(s->pb, pos, SEEK_SET);
 
 //printf("asf_read_pts\n");
     asf_reset_header(s);
@@ -1188,7 +1188,7 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
     int64_t current_pos= url_ftell(s->pb);
     int i;
 
-    url_fseek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET);
+    avio_seek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET);
     ff_get_guid(s->pb, &g);
 
     /* the data object can be followed by other top-level objects,
@@ -1196,10 +1196,10 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
     while (ff_guidcmp(&g, &index_guid)) {
         int64_t gsize= avio_rl64(s->pb);
         if (gsize < 24 || url_feof(s->pb)) {
-            url_fseek(s->pb, current_pos, SEEK_SET);
+            avio_seek(s->pb, current_pos, SEEK_SET);
             return;
         }
-        url_fseek(s->pb, gsize-24, SEEK_CUR);
+        avio_seek(s->pb, gsize-24, SEEK_CUR);
         ff_get_guid(s->pb, &g);
     }
 
@@ -1227,7 +1227,7 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
         }
         asf->index_read= 1;
     }
-    url_fseek(s->pb, current_pos, SEEK_SET);
+    avio_seek(s->pb, current_pos, SEEK_SET);
 }
 
 static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags)
@@ -1265,7 +1265,7 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int
 
     // various attempts to find key frame have failed so far
     //    asf_reset_header(s);
-    //    url_fseek(s->pb, pos, SEEK_SET);
+    //    avio_seek(s->pb, pos, SEEK_SET);
     //    key_pos = pos;
     //     for(i=0;i<16;i++){
     //         pos = url_ftell(s->pb);
@@ -1286,7 +1286,7 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int
 
         /* do the seek */
         av_log(s, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", pos);
-        url_fseek(s->pb, pos, SEEK_SET);
+        avio_seek(s->pb, pos, SEEK_SET);
     }
     asf_reset_header(s);
     return 0;

+ 9 - 9
libavformat/asfenc.c

@@ -260,9 +260,9 @@ static void end_header(AVIOContext *pb, int64_t pos)
     int64_t pos1;
 
     pos1 = url_ftell(pb);
-    url_fseek(pb, pos + 16, SEEK_SET);
+    avio_seek(pb, pos + 16, SEEK_SET);
     avio_wl64(pb, pos1 - pos);
-    url_fseek(pb, pos1, SEEK_SET);
+    avio_seek(pb, pos1, SEEK_SET);
 }
 
 /* write an asf chunk (only used in streaming case) */
@@ -443,9 +443,9 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
                 return -1;
             if (wavsize != extra_size) {
                 cur_pos = url_ftell(pb);
-                url_fseek(pb, es_pos, SEEK_SET);
+                avio_seek(pb, es_pos, SEEK_SET);
                 avio_wl32(pb, wavsize); /* wav header len */
-                url_fseek(pb, cur_pos, SEEK_SET);
+                avio_seek(pb, cur_pos, SEEK_SET);
             }
             /* ERROR Correction */
             avio_w8(pb, 0x01);
@@ -530,17 +530,17 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
     if (asf->is_streamed) {
         header_size += 8 + 30 + 50;
 
-        url_fseek(pb, header_offset - 10 - 30, SEEK_SET);
+        avio_seek(pb, header_offset - 10 - 30, SEEK_SET);
         avio_wl16(pb, header_size);
-        url_fseek(pb, header_offset - 2 - 30, SEEK_SET);
+        avio_seek(pb, header_offset - 2 - 30, SEEK_SET);
         avio_wl16(pb, header_size);
 
         header_size -= 8 + 30 + 50;
     }
     header_size += 24 + 6;
-    url_fseek(pb, header_offset - 14, SEEK_SET);
+    avio_seek(pb, header_offset - 14, SEEK_SET);
     avio_wl64(pb, header_size);
-    url_fseek(pb, cur_pos, SEEK_SET);
+    avio_seek(pb, cur_pos, SEEK_SET);
 
     /* movie chunk, followed by packets of packet_size */
     asf->data_offset = cur_pos;
@@ -871,7 +871,7 @@ static int asf_write_trailer(AVFormatContext *s)
     } else {
         /* rewrite an updated header */
         file_size = url_ftell(s->pb);
-        url_fseek(s->pb, 0, SEEK_SET);
+        avio_seek(s->pb, 0, SEEK_SET);
         asf_write_header1(s, file_size, data_size - asf->data_offset);
     }
 

+ 3 - 3
libavformat/au.c

@@ -95,9 +95,9 @@ static int au_write_trailer(AVFormatContext *s)
 
         /* update file size */
         file_size = url_ftell(pb);
-        url_fseek(pb, 8, SEEK_SET);
+        avio_seek(pb, 8, SEEK_SET);
         avio_wb32(pb, (uint32_t)(file_size - 24));
-        url_fseek(pb, file_size, SEEK_SET);
+        avio_seek(pb, file_size, SEEK_SET);
 
         put_flush_packet(pb);
     }
@@ -147,7 +147,7 @@ static int au_read_header(AVFormatContext *s,
 
     if (size >= 24) {
         /* skip unused data */
-        url_fseek(pb, size - 24, SEEK_CUR);
+        avio_seek(pb, size - 24, SEEK_CUR);
     }
 
     /* now we are ready: build format streams */

+ 12 - 12
libavformat/avidec.c

@@ -205,13 +205,13 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){
                 return -1;
             }
 
-            url_fseek(pb, offset+8, SEEK_SET);
+            avio_seek(pb, offset+8, SEEK_SET);
             avi->odml_depth++;
             read_braindead_odml_indx(s, frame_num);
             avi->odml_depth--;
             frame_num += duration;
 
-            url_fseek(pb, pos, SEEK_SET);
+            avio_seek(pb, pos, SEEK_SET);
         }
     }
     avi->index_loaded=1;
@@ -668,7 +668,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
             if(!url_is_streamed(pb) && !(s->flags & AVFMT_FLAG_IGNIDX)){
                 read_braindead_odml_indx(s, 0);
             }
-            url_fseek(pb, i+size, SEEK_SET);
+            avio_seek(pb, i+size, SEEK_SET);
             break;
         case MKTAG('v', 'p', 'r', 'p'):
             if(stream_index < (unsigned)s->nb_streams && size > 9*4){
@@ -693,7 +693,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
                 }
                 size -= 9*4;
             }
-            url_fseek(pb, size, SEEK_CUR);
+            avio_seek(pb, size, SEEK_CUR);
             break;
         case MKTAG('s', 't', 'r', 'n'):
             if(s->nb_streams){
@@ -892,7 +892,7 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
         if(i>=0){
             int64_t pos= best_st->index_entries[i].pos;
             pos += best_ast->packet_size - best_ast->remaining;
-            url_fseek(s->pb, pos + 8, SEEK_SET);
+            avio_seek(s->pb, pos + 8, SEEK_SET);
 //        av_log(s, AV_LOG_DEBUG, "pos=%"PRId64"\n", pos);
 
             assert(best_ast->remaining <= best_ast->packet_size);
@@ -1174,7 +1174,7 @@ static int guess_ni_flag(AVFormatContext *s){
 
         if(n >= 2){
             int64_t pos= st->index_entries[0].pos;
-            url_fseek(s->pb, pos + 4, SEEK_SET);
+            avio_seek(s->pb, pos + 4, SEEK_SET);
             size= avio_rl32(s->pb);
             if(pos + size > st->index_entries[1].pos)
                 last_start= INT64_MAX;
@@ -1185,7 +1185,7 @@ static int guess_ni_flag(AVFormatContext *s){
         if(st->index_entries[n-1].pos < first_end)
             first_end= st->index_entries[n-1].pos;
     }
-    url_fseek(s->pb, oldpos, SEEK_SET);
+    avio_seek(s->pb, oldpos, SEEK_SET);
     return last_start > first_end;
 }
 
@@ -1197,7 +1197,7 @@ static int avi_load_index(AVFormatContext *s)
     int64_t pos= url_ftell(pb);
     int ret = -1;
 
-    if (url_fseek(pb, avi->movi_end, SEEK_SET) < 0)
+    if (avio_seek(pb, avi->movi_end, SEEK_SET) < 0)
         goto the_end; // maybe truncated file
 #ifdef DEBUG_SEEK
     printf("movi_end=0x%"PRIx64"\n", avi->movi_end);
@@ -1225,13 +1225,13 @@ static int avi_load_index(AVFormatContext *s)
         default:
         skip:
             size += (size & 1);
-            if (url_fseek(pb, size, SEEK_CUR) < 0)
+            if (avio_seek(pb, size, SEEK_CUR) < 0)
                 goto the_end; // something is wrong here
             break;
         }
     }
  the_end:
-    url_fseek(pb, pos, SEEK_SET);
+    avio_seek(pb, pos, SEEK_SET);
     return ret;
 }
 
@@ -1282,7 +1282,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
         /* DV demux so it can synthesize correct timestamps.        */
         dv_offset_reset(avi->dv_demux, timestamp);
 
-        url_fseek(s->pb, pos, SEEK_SET);
+        avio_seek(s->pb, pos, SEEK_SET);
         avi->stream_index= -1;
         return 0;
     }
@@ -1324,7 +1324,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
     }
 
     /* do the seek */
-    url_fseek(s->pb, pos, SEEK_SET);
+    avio_seek(s->pb, pos, SEEK_SET);
     avi->stream_index= -1;
     return 0;
 }

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