[FFmpeg-devel] [PATCH 04/10] avio: rename ByteIOContext->AVIOContext

Anton Khirnov anton
Sat Feb 19 12:42:48 CET 2011


---
 ffserver.c                   |   10 +-
 libavformat/4xm.c            |    4 +-
 libavformat/adtsenc.c        |    2 +-
 libavformat/aiffdec.c        |    6 +-
 libavformat/aiffenc.c        |    6 +-
 libavformat/amr.c            |    4 +-
 libavformat/anm.c            |    4 +-
 libavformat/apc.c            |    2 +-
 libavformat/ape.c            |    2 +-
 libavformat/apetag.c         |    4 +-
 libavformat/applehttp.c      |    8 +-
 libavformat/asf.h            |    2 +-
 libavformat/asfdec.c         |   28 +++---
 libavformat/asfenc.c         |   26 +++---
 libavformat/assdec.c         |    2 +-
 libavformat/au.c             |   10 +-
 libavformat/avc.c            |    6 +-
 libavformat/avc.h            |    4 +-
 libavformat/avformat.h       |   10 +-
 libavformat/avidec.c         |   16 ++--
 libavformat/avienc.c         |   16 ++--
 libavformat/avio.h           |  204 +++++++++++++++++++++--------------------
 libavformat/aviobuf.c        |  152 ++++++++++++++++----------------
 libavformat/bethsoftvid.c    |    6 +-
 libavformat/bfi.c            |    4 +-
 libavformat/bink.c           |    4 +-
 libavformat/c93.c            |    4 +-
 libavformat/cafdec.c         |   12 ++--
 libavformat/daud.c           |    2 +-
 libavformat/dsicin.c         |    8 +-
 libavformat/dxa.c            |    2 +-
 libavformat/eacdata.c        |    2 +-
 libavformat/electronicarts.c |   16 ++--
 libavformat/ffmdec.c         |   10 +-
 libavformat/ffmenc.c         |    6 +-
 libavformat/ffmetadec.c      |    2 +-
 libavformat/ffmetaenc.c      |    4 +-
 libavformat/filmstripdec.c   |    2 +-
 libavformat/filmstripenc.c   |    2 +-
 libavformat/flacenc.c        |    6 +-
 libavformat/flacenc.h        |    2 +-
 libavformat/flacenc_header.c |    2 +-
 libavformat/flic.c           |    4 +-
 libavformat/flvdec.c         |    6 +-
 libavformat/flvenc.c         |   14 ++--
 libavformat/gif.c            |   10 +-
 libavformat/gxf.c            |   18 ++--
 libavformat/gxfenc.c         |   52 ++++++------
 libavformat/id3v2.c          |    8 +-
 libavformat/idcin.c          |    4 +-
 libavformat/idroqdec.c       |    4 +-
 libavformat/iff.c            |    4 +-
 libavformat/img2.c           |    4 +-
 libavformat/internal.h       |    8 +-
 libavformat/ipmovie.c        |    8 +-
 libavformat/isom.c           |    6 +-
 libavformat/isom.h           |   12 ++--
 libavformat/iss.c            |    4 +-
 libavformat/ivfenc.c         |    4 +-
 libavformat/libnut.c         |   12 ++--
 libavformat/lmlm4.c          |    2 +-
 libavformat/lxfdec.c         |    6 +-
 libavformat/matroskadec.c    |   22 +++---
 libavformat/matroskaenc.c    |   56 ++++++------
 libavformat/mm.c             |    4 +-
 libavformat/mmf.c            |   12 ++--
 libavformat/mmst.c           |    2 +-
 libavformat/mov.c            |   98 ++++++++++----------
 libavformat/movenc.c         |  136 ++++++++++++++--------------
 libavformat/movenchint.c     |   10 +-
 libavformat/mp3enc.c         |    4 +-
 libavformat/mpc8.c           |    6 +-
 libavformat/mpeg.c           |    8 +-
 libavformat/mpegenc.c        |    4 +-
 libavformat/mpegts.c         |   10 +-
 libavformat/mpegtsenc.c      |    2 +-
 libavformat/msnwc_tcp.c      |    4 +-
 libavformat/mtv.c            |    4 +-
 libavformat/mvi.c            |    6 +-
 libavformat/mxfdec.c         |   36 ++++----
 libavformat/mxfenc.c         |   66 +++++++-------
 libavformat/nsvdec.c         |    8 +-
 libavformat/nutdec.c         |   40 ++++----
 libavformat/nutenc.c         |   36 ++++----
 libavformat/nuv.c            |    6 +-
 libavformat/oggdec.c         |    6 +-
 libavformat/oggenc.c         |    4 +-
 libavformat/psxstr.c         |    4 +-
 libavformat/pva.c            |    6 +-
 libavformat/qcp.c            |    4 +-
 libavformat/rdt.c            |    4 +-
 libavformat/riff.c           |   12 ++--
 libavformat/riff.h           |   12 ++--
 libavformat/rl2.c            |    4 +-
 libavformat/rm.h             |   12 ++--
 libavformat/rmdec.c          |   24 +++---
 libavformat/rmenc.c          |   14 ++--
 libavformat/rpl.c            |    8 +-
 libavformat/rsodec.c         |    2 +-
 libavformat/rsoenc.c         |    4 +-
 libavformat/rtpdec.c         |    4 +-
 libavformat/rtpdec_asf.c     |   10 +-
 libavformat/rtpdec_latm.c    |    2 +-
 libavformat/rtpdec_qt.c      |    2 +-
 libavformat/rtpdec_svq3.c    |    2 +-
 libavformat/rtpdec_vp8.c     |    2 +-
 libavformat/rtpdec_xiph.c    |    2 +-
 libavformat/rtsp.c           |    2 +-
 libavformat/rtsp.h           |    4 +-
 libavformat/sapdec.c         |    2 +-
 libavformat/sauce.c          |    2 +-
 libavformat/segafilm.c       |    4 +-
 libavformat/sierravmd.c      |    4 +-
 libavformat/siff.c           |    6 +-
 libavformat/smacker.c        |    2 +-
 libavformat/sol.c            |    2 +-
 libavformat/soxdec.c         |    2 +-
 libavformat/soxenc.c         |    6 +-
 libavformat/spdifdec.c       |    2 +-
 libavformat/spdifenc.c       |    2 +-
 libavformat/swfdec.c         |    6 +-
 libavformat/swfenc.c         |   14 ++--
 libavformat/thp.c            |    4 +-
 libavformat/tiertexseq.c     |   10 +-
 libavformat/tmv.c            |    4 +-
 libavformat/tty.c            |    2 +-
 libavformat/txd.c            |    2 +-
 libavformat/utils.c          |   14 ++--
 libavformat/vc1test.c        |    4 +-
 libavformat/vc1testenc.c     |    6 +-
 libavformat/vocdec.c         |    4 +-
 libavformat/vocenc.c         |    4 +-
 libavformat/wav.c            |   16 ++--
 libavformat/wc3movie.c       |    4 +-
 libavformat/westwood.c       |    8 +-
 libavformat/wtv.c            |   36 ++++----
 libavformat/wv.c             |    4 +-
 libavformat/xa.c             |    4 +-
 libavformat/yop.c            |    4 +-
 libavformat/yuv4mpeg.c       |    4 +-
 140 files changed, 868 insertions(+), 864 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 7a16b2d..c2563b7 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -163,7 +163,7 @@ typedef struct HTTPContext {
 
     /* RTSP state specific */
     uint8_t *pb_buffer; /* XXX: use that in all the code */
-    ByteIOContext *pb;
+    AVIOContext *pb;
     int seq; /* RTSP sequence number */
 
     /* RTP state specific */
@@ -1854,7 +1854,7 @@ static int http_parse_request(HTTPContext *c)
     return 0;
 }
 
-static void fmt_bytecount(ByteIOContext *pb, int64_t count)
+static void fmt_bytecount(AVIOContext *pb, int64_t count)
 {
     static const char *suffix = " kMGTP";
     const char *s;
@@ -1871,7 +1871,7 @@ static void compute_status(HTTPContext *c)
     char *p;
     time_t ti;
     int i, len;
-    ByteIOContext *pb;
+    AVIOContext *pb;
 
     if (url_open_dyn_buf(&pb) < 0) {
         /* XXX: return an error ? */
@@ -2491,7 +2491,7 @@ static int http_send_data(HTTPContext *c)
 
                 if (c->rtp_protocol == RTSP_LOWER_TRANSPORT_TCP) {
                     /* RTP packets are sent inside the RTSP TCP connection */
-                    ByteIOContext *pb;
+                    AVIOContext *pb;
                     int interleaved_index, size;
                     uint8_t header[4];
                     HTTPContext *rtsp_c;
@@ -2712,7 +2712,7 @@ static int http_receive_data(HTTPContext *c)
         } else {
             /* We have a header in our hands that contains useful data */
             AVFormatContext *s = NULL;
-            ByteIOContext *pb;
+            AVIOContext *pb;
             AVInputFormat *fmt_in;
             int i;
 
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 7c32f10..eee4679 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -92,7 +92,7 @@ static int fourxm_probe(AVProbeData *p)
 static int fourxm_read_header(AVFormatContext *s,
                               AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned int fourcc_tag;
     unsigned int size;
     int header_size;
@@ -244,7 +244,7 @@ static int fourxm_read_packet(AVFormatContext *s,
                               AVPacket *pkt)
 {
     FourxmDemuxContext *fourxm = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned int fourcc_tag;
     unsigned int size, out_size;
     int ret = 0;
diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c
index 147e205..7de17fc 100644
--- a/libavformat/adtsenc.c
+++ b/libavformat/adtsenc.c
@@ -118,7 +118,7 @@ int ff_adts_write_frame_header(ADTSContext *ctx,
 static int adts_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     ADTSContext *adts = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     uint8_t buf[ADTS_HEADER_SIZE];
 
     if (!pkt->size)
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 0aa432b..b02caa1 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -47,7 +47,7 @@ static enum CodecID aiff_codec_get_id(int bps)
 }
 
 /* returns the size of the found tag */
-static int get_tag(ByteIOContext *pb, uint32_t * tag)
+static int get_tag(AVIOContext *pb, uint32_t * tag)
 {
     int size;
 
@@ -83,7 +83,7 @@ static void get_meta(AVFormatContext *s, const char *key, int size)
 }
 
 /* Returns the number of sound data frames or negative on error */
-static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
+static unsigned int get_aiff_header(AVIOContext *pb, AVCodecContext *codec,
                              int size, unsigned version)
 {
     AVExtFloat ext;
@@ -177,7 +177,7 @@ static int aiff_read_header(AVFormatContext *s,
     int64_t offset = 0;
     uint32_t tag;
     unsigned version = AIFF_C_VERSION1;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream * st;
     AIFFInputContext *aiff = s->priv_data;
 
diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c
index 27a1b64..3578459 100644
--- a/libavformat/aiffenc.c
+++ b/libavformat/aiffenc.c
@@ -31,7 +31,7 @@ typedef struct {
 static int aiff_write_header(AVFormatContext *s)
 {
     AIFFOutputContext *aiff = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVCodecContext *enc = s->streams[0]->codec;
     AVExtFloat sample_rate;
     int aifc = 0;
@@ -104,14 +104,14 @@ static int aiff_write_header(AVFormatContext *s)
 
 static int aiff_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     avio_put_buffer(pb, pkt->data, pkt->size);
     return 0;
 }
 
 static int aiff_write_trailer(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AIFFOutputContext *aiff = s->priv_data;
     AVCodecContext *enc = s->streams[0]->codec;
 
diff --git a/libavformat/amr.c b/libavformat/amr.c
index 860e315..ab392be 100644
--- a/libavformat/amr.c
+++ b/libavformat/amr.c
@@ -33,7 +33,7 @@ static const char AMRWB_header [] = "#!AMR-WB\n";
 #if CONFIG_AMR_MUXER
 static int amr_write_header(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVCodecContext *enc = s->streams[0]->codec;
 
     s->priv_data = NULL;
@@ -78,7 +78,7 @@ static int amr_probe(AVProbeData *p)
 static int amr_read_header(AVFormatContext *s,
                            AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     uint8_t header[9];
 
diff --git a/libavformat/anm.c b/libavformat/anm.c
index 6e4e2b6..c48c317 100644
--- a/libavformat/anm.c
+++ b/libavformat/anm.c
@@ -79,7 +79,7 @@ static int read_header(AVFormatContext *s,
                        AVFormatParameters *ap)
 {
     AnmDemuxContext *anm = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     int i, ret;
 
@@ -177,7 +177,7 @@ static int read_packet(AVFormatContext *s,
                        AVPacket *pkt)
 {
     AnmDemuxContext *anm = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     Page *p;
     int tmp, record_size;
 
diff --git a/libavformat/apc.c b/libavformat/apc.c
index 20f931c..2d56a1f 100644
--- a/libavformat/apc.c
+++ b/libavformat/apc.c
@@ -32,7 +32,7 @@ static int apc_probe(AVProbeData *p)
 
 static int apc_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
 
     avio_get_le32(pb); /* CRYO */
diff --git a/libavformat/ape.c b/libavformat/ape.c
index d73c664..3dab495 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -151,7 +151,7 @@ static void ape_dumpinfo(AVFormatContext * s, APEContext * ape_ctx)
 
 static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     APEContext *ape = s->priv_data;
     AVStream *st;
     uint32_t tag;
diff --git a/libavformat/apetag.c b/libavformat/apetag.c
index 1676e2a..d70a478 100644
--- a/libavformat/apetag.c
+++ b/libavformat/apetag.c
@@ -33,7 +33,7 @@
 
 static int ape_tag_read_field(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     uint8_t key[1024], *value;
     uint32_t size, flags;
     int i, c;
@@ -65,7 +65,7 @@ static int ape_tag_read_field(AVFormatContext *s)
 
 void ff_ape_parse_tag(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int file_size = url_fsize(pb);
     uint32_t val, fields, tag_bytes;
     uint8_t buf[8];
diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c
index 37a040c..e35aaa8 100644
--- a/libavformat/applehttp.c
+++ b/libavformat/applehttp.c
@@ -50,13 +50,13 @@ struct segment {
 
 /*
  * Each variant has its own demuxer. If it currently is active,
- * it has an open ByteIOContext too, and potentially an AVPacket
+ * it has an open AVIOContext too, and potentially an AVPacket
  * containing the next packet from this stream.
  */
 struct variant {
     int bandwidth;
     char url[MAX_URL_SIZE];
-    ByteIOContext *pb;
+    AVIOContext *pb;
     AVFormatContext *ctx;
     AVPacket pkt;
     int stream_offset;
@@ -78,7 +78,7 @@ typedef struct AppleHTTPContext {
     int max_start_seq, min_end_seq;
 } AppleHTTPContext;
 
-static int read_chomp_line(ByteIOContext *s, char *buf, int maxlen)
+static int read_chomp_line(AVIOContext *s, char *buf, int maxlen)
 {
     int len = ff_get_line(s, buf, maxlen);
     while (len > 0 && isspace(buf[len - 1]))
@@ -202,7 +202,7 @@ static void handle_variant_args(struct variant_info *info, const char *key,
 }
 
 static int parse_playlist(AppleHTTPContext *c, const char *url,
-                          struct variant *var, ByteIOContext *in)
+                          struct variant *var, AVIOContext *in)
 {
     int ret = 0, duration = 0, is_segment = 0, is_variant = 0, bandwidth = 0;
     char line[1024];
diff --git a/libavformat/asf.h b/libavformat/asf.h
index e89bd28..94c93d2 100644
--- a/libavformat/asf.h
+++ b/libavformat/asf.h
@@ -178,6 +178,6 @@ static av_always_inline int ff_guidcmp(const void *g1, const void *g2)
     return memcmp(g1, g2, sizeof(ff_asf_guid));
 }
 
-void ff_get_guid(ByteIOContext *s, ff_asf_guid *g);
+void ff_get_guid(AVIOContext *s, ff_asf_guid *g);
 
 #endif /* AVFORMAT_ASF_H */
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index eb3b43a..e7b0418 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -132,7 +132,7 @@ static void print_guid(const ff_asf_guid *g)
 #define print_guid(g)
 #endif
 
-void ff_get_guid(ByteIOContext *s, ff_asf_guid *g)
+void ff_get_guid(AVIOContext *s, ff_asf_guid *g)
 {
     assert(sizeof(*g) == 16);
     avio_get_buffer(s, *g, sizeof(*g));
@@ -147,7 +147,7 @@ static int asf_probe(AVProbeData *pd)
         return 0;
 }
 
-static int get_value(ByteIOContext *pb, int type){
+static int get_value(AVIOContext *pb, int type){
     switch(type){
         case 2: return avio_get_le32(pb);
         case 3: return avio_get_le32(pb);
@@ -188,7 +188,7 @@ finish:
 static int asf_read_file_properties(AVFormatContext *s, int64_t size)
 {
     ASFContext *asf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     ff_get_guid(pb, &asf->hdr.guid);
     asf->hdr.file_size          = avio_get_le64(pb);
@@ -210,7 +210,7 @@ static int asf_read_file_properties(AVFormatContext *s, int64_t size)
 static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
 {
     ASFContext *asf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     ASFStream *asf_st;
     ff_asf_guid g;
@@ -396,7 +396,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
 static int asf_read_ext_stream_properties(AVFormatContext *s, int64_t size)
 {
     ASFContext *asf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     ff_asf_guid g;
     int ext_len, payload_ext_ct, stream_ct, i;
     uint32_t ext_d, leak_rate, stream_num;
@@ -443,7 +443,7 @@ static int asf_read_ext_stream_properties(AVFormatContext *s, int64_t size)
 
 static int asf_read_content_desc(AVFormatContext *s, int64_t size)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int len1, len2, len3, len4, len5;
 
     len1 = avio_get_le16(pb);
@@ -462,7 +462,7 @@ static int asf_read_content_desc(AVFormatContext *s, int64_t size)
 
 static int asf_read_ext_content_desc(AVFormatContext *s, int64_t size)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     ASFContext *asf = s->priv_data;
     int desc_count, i, ret;
 
@@ -497,7 +497,7 @@ static int asf_read_ext_content_desc(AVFormatContext *s, int64_t size)
 
 static int asf_read_language_list(AVFormatContext *s, int64_t size)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     ASFContext *asf = s->priv_data;
     int j, ret;
     int stream_count = avio_get_le16(pb);
@@ -515,7 +515,7 @@ static int asf_read_language_list(AVFormatContext *s, int64_t size)
 
 static int asf_read_metadata(AVFormatContext *s, int64_t size)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     ASFContext *asf = s->priv_data;
     int n, stream_num, name_len, value_len, value_type, value_num;
     int ret, i;
@@ -547,7 +547,7 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size)
 
 static int asf_read_marker(AVFormatContext *s, int64_t size)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int i, count, name_len, ret;
     char name[1024];
 
@@ -582,7 +582,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     ASFContext *asf = s->priv_data;
     ff_asf_guid g;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int i;
     int64_t gsize;
 
@@ -716,7 +716,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
  * @param pb context to read data from
  * @return 0 on success, <0 on error
  */
-static int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb)
+static int ff_asf_get_packet(AVFormatContext *s, AVIOContext *pb)
 {
     ASFContext *asf = s->priv_data;
     uint32_t packet_length, padsize;
@@ -801,7 +801,7 @@ static int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb)
  *
  * @return <0 if error
  */
-static int asf_read_frame_header(AVFormatContext *s, ByteIOContext *pb){
+static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
     ASFContext *asf = s->priv_data;
     int rsize = 1;
     int num = avio_get_byte(pb);
@@ -880,7 +880,7 @@ static int asf_read_frame_header(AVFormatContext *s, ByteIOContext *pb){
  * @return 0 if data was stored in pkt, <0 on error or 1 if more ASF
  *          packets need to be loaded (through asf_get_packet())
  */
-static int ff_asf_parse_packet(AVFormatContext *s, ByteIOContext *pb, AVPacket *pkt)
+static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
 {
     ASFContext *asf = s->priv_data;
     ASFStream *asf_st = 0;
diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index 799b993..7fbc1cf 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -202,7 +202,7 @@ typedef struct {
     int packet_timestamp_end;
     unsigned int packet_nb_payloads;
     uint8_t packet_buf[PACKET_SIZE];
-    ByteIOContext pb;
+    AVIOContext pb;
     /* only for reading */
     uint64_t data_offset;                ///< beginning of the first data packet
 
@@ -222,17 +222,17 @@ static const AVCodecTag codec_asf_bmp_tags[] = {
 
 #define PREROLL_TIME 3100
 
-static void put_guid(ByteIOContext *s, const ff_asf_guid *g)
+static void put_guid(AVIOContext *s, const ff_asf_guid *g)
 {
     assert(sizeof(*g) == 16);
     avio_put_buffer(s, *g, sizeof(*g));
 }
 
-static void put_str16(ByteIOContext *s, const char *tag)
+static void put_str16(AVIOContext *s, const char *tag)
 {
     int len;
     uint8_t *pb;
-    ByteIOContext *dyn_buf;
+    AVIOContext *dyn_buf;
     if (url_open_dyn_buf(&dyn_buf) < 0)
         return;
 
@@ -243,7 +243,7 @@ static void put_str16(ByteIOContext *s, const char *tag)
     av_freep(&pb);
 }
 
-static int64_t put_header(ByteIOContext *pb, const ff_asf_guid *g)
+static int64_t put_header(AVIOContext *pb, const ff_asf_guid *g)
 {
     int64_t pos;
 
@@ -254,7 +254,7 @@ static int64_t put_header(ByteIOContext *pb, const ff_asf_guid *g)
 }
 
 /* update header size */
-static void end_header(ByteIOContext *pb, int64_t pos)
+static void end_header(AVIOContext *pb, int64_t pos)
 {
     int64_t pos1;
 
@@ -268,7 +268,7 @@ static void end_header(ByteIOContext *pb, int64_t pos)
 static void put_chunk(AVFormatContext *s, int type, int payload_length, int flags)
 {
     ASFContext *asf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int length;
 
     length = payload_length + 8;
@@ -294,7 +294,7 @@ static int64_t unix_to_file_time(int ti)
 static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data_chunk_size)
 {
     ASFContext *asf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVMetadataTag *tags[5];
     int header_size, n, extra_size, extra_size2, wav_extra_size, file_time;
     int has_title;
@@ -363,7 +363,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
     if (has_title) {
         int len;
         uint8_t *buf;
-        ByteIOContext *dyn_buf;
+        AVIOContext *dyn_buf;
 
         if (url_open_dyn_buf(&dyn_buf) < 0)
             return AVERROR(ENOMEM);
@@ -479,7 +479,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
         const char *desc;
         int len;
         uint8_t *buf;
-        ByteIOContext *dyn_buf;
+        AVIOContext *dyn_buf;
 
         enc = s->streams[n]->codec;
         p = avcodec_find_encoder(enc->codec_id);
@@ -602,7 +602,7 @@ static int put_payload_parsing_info(
             )
 {
     ASFContext *asf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int ppi_size, i;
     int64_t start= url_ftell(pb);
 
@@ -691,7 +691,7 @@ static void put_payload_header(
             )
 {
     ASFContext *asf = s->priv_data;
-    ByteIOContext *pb = &asf->pb;
+    AVIOContext *pb = &asf->pb;
     int val;
 
     val = stream->num;
@@ -832,7 +832,7 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt)
 //
 static int asf_write_index(AVFormatContext *s, ASFIndex *index, uint16_t max, uint32_t count)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int i;
 
     put_guid(pb, &ff_asf_simple_index_header);
diff --git a/libavformat/assdec.c b/libavformat/assdec.c
index 86f0339..e04d92a 100644
--- a/libavformat/assdec.c
+++ b/libavformat/assdec.c
@@ -76,7 +76,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     int i, len, header_remaining;
     ASSContext *ass = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     int allocated[2]={0};
     uint8_t *p, **dst[2]={0};
diff --git a/libavformat/au.c b/libavformat/au.c
index d3f7229..0569ec4 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -49,7 +49,7 @@ static const AVCodecTag codec_au_tags[] = {
 
 #if CONFIG_AU_MUXER
 /* AUDIO_FILE header */
-static int put_au_header(ByteIOContext *pb, AVCodecContext *enc)
+static int put_au_header(AVIOContext *pb, AVCodecContext *enc)
 {
     if(!enc->codec_tag)
         return -1;
@@ -64,7 +64,7 @@ static int put_au_header(ByteIOContext *pb, AVCodecContext *enc)
 
 static int au_write_header(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     s->priv_data = NULL;
 
@@ -80,14 +80,14 @@ static int au_write_header(AVFormatContext *s)
 
 static int au_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     avio_put_buffer(pb, pkt->data, pkt->size);
     return 0;
 }
 
 static int au_write_trailer(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t file_size;
 
     if (!url_is_streamed(s->pb)) {
@@ -121,7 +121,7 @@ static int au_read_header(AVFormatContext *s,
 {
     int size;
     unsigned int tag;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned int id, channels, rate;
     enum CodecID codec;
     AVStream *st;
diff --git a/libavformat/avc.c b/libavformat/avc.c
index 5eac1db..1432516 100644
--- a/libavformat/avc.c
+++ b/libavformat/avc.c
@@ -67,7 +67,7 @@ const uint8_t *ff_avc_find_startcode(const uint8_t *p, const uint8_t *end){
     return out;
 }
 
-int ff_avc_parse_nal_units(ByteIOContext *pb, const uint8_t *buf_in, int size)
+int ff_avc_parse_nal_units(AVIOContext *pb, const uint8_t *buf_in, int size)
 {
     const uint8_t *p = buf_in;
     const uint8_t *end = p + size;
@@ -88,7 +88,7 @@ int ff_avc_parse_nal_units(ByteIOContext *pb, const uint8_t *buf_in, int size)
 
 int ff_avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size)
 {
-    ByteIOContext *pb;
+    AVIOContext *pb;
     int ret = url_open_dyn_buf(&pb);
     if(ret < 0)
         return ret;
@@ -100,7 +100,7 @@ int ff_avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size)
     return 0;
 }
 
-int ff_isom_write_avcc(ByteIOContext *pb, const uint8_t *data, int len)
+int ff_isom_write_avcc(AVIOContext *pb, const uint8_t *data, int len)
 {
     if (len > 6) {
         /* check for h264 start code */
diff --git a/libavformat/avc.h b/libavformat/avc.h
index 2deb77d..46e5e37 100644
--- a/libavformat/avc.h
+++ b/libavformat/avc.h
@@ -25,9 +25,9 @@
 #include <stdint.h>
 #include "avio.h"
 
-int ff_avc_parse_nal_units(ByteIOContext *s, const uint8_t *buf, int size);
+int ff_avc_parse_nal_units(AVIOContext *s, const uint8_t *buf, int size);
 int ff_avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size);
-int ff_isom_write_avcc(ByteIOContext *pb, const uint8_t *data, int len);
+int ff_isom_write_avcc(AVIOContext *pb, const uint8_t *data, int len);
 const uint8_t *ff_avc_find_startcode(const uint8_t *p, const uint8_t *end);
 
 #endif /* AVFORMAT_AVC_H */
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 8511a03..3fd7f75 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -193,7 +193,7 @@ void av_metadata_free(AVMetadata **m);
  * @param size desired payload size
  * @return >0 (read size) if OK, AVERROR_xxx otherwise
  */
-int av_get_packet(ByteIOContext *s, AVPacket *pkt, int size);
+int av_get_packet(AVIOContext *s, AVPacket *pkt, int size);
 
 
 /**
@@ -209,7 +209,7 @@ int av_get_packet(ByteIOContext *s, AVPacket *pkt, int size);
  * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data
  *         will not be lost even if an error occurs.
  */
-int av_append_packet(ByteIOContext *s, AVPacket *pkt, int size);
+int av_append_packet(AVIOContext *s, AVPacket *pkt, int size);
 
 /*************************************************/
 /* fractional numbers for exact pts handling */
@@ -688,7 +688,7 @@ typedef struct AVFormatContext {
     struct AVInputFormat *iformat;
     struct AVOutputFormat *oformat;
     void *priv_data;
-    ByteIOContext *pb;
+    AVIOContext *pb;
     unsigned int nb_streams;
 #if FF_API_MAX_STREAMS
     AVStream *streams[MAX_STREAMS];
@@ -1060,7 +1060,7 @@ AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score
  * @return 0 in case of success, a negative value corresponding to an
  * AVERROR code otherwise
  */
-int av_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt,
+int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
                           const char *filename, void *logctx,
                           unsigned int offset, unsigned int max_probe_size);
 
@@ -1069,7 +1069,7 @@ int av_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt,
  *        This does not open the needed codecs for decoding the stream[s].
  */
 int av_open_input_stream(AVFormatContext **ic_ptr,
-                         ByteIOContext *pb, const char *filename,
+                         AVIOContext *pb, const char *filename,
                          AVInputFormat *fmt, AVFormatParameters *ap);
 
 /**
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 3130ba8..6d5e695 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -100,7 +100,7 @@ static inline int get_duration(AVIStream *ast, int len){
         return 1;
 }
 
-static int get_riff(AVFormatContext *s, ByteIOContext *pb)
+static int get_riff(AVFormatContext *s, AVIOContext *pb)
 {
     AVIContext *avi = s->priv_data;
     char header[8];
@@ -126,7 +126,7 @@ static int get_riff(AVFormatContext *s, ByteIOContext *pb)
 
 static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){
     AVIContext *avi = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int longs_pre_entry= avio_get_le16(pb);
     int index_sub_type = avio_get_byte(pb);
     int index_type     = avio_get_byte(pb);
@@ -246,7 +246,7 @@ static void clean_index(AVFormatContext *s){
 
 static int avi_read_tag(AVFormatContext *s, AVStream *st, uint32_t tag, uint32_t size)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     char key[5] = {0}, *value;
 
     size += (size & 1);
@@ -335,7 +335,7 @@ static void avi_read_nikon(AVFormatContext *s, uint64_t end)
 static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     AVIContext *avi = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned int tag, tag1, handler;
     int codec_type, stream_index, frame_period, bit_rate;
     unsigned int size;
@@ -752,7 +752,7 @@ static int read_gab2_sub(AVStream *st, AVPacket *pkt) {
         AVIStream *ast = st->priv_data;
         AVInputFormat *sub_demuxer;
         AVRational time_base;
-        ByteIOContext *pb = av_alloc_put_byte(pkt->data + 7,
+        AVIOContext *pb = av_alloc_put_byte(pkt->data + 7,
                                               pkt->size - 7,
                                               0, NULL, NULL, NULL, NULL);
         AVProbeData pd;
@@ -834,7 +834,7 @@ static int get_stream_idx(int *d){
 static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     AVIContext *avi = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int n, d[8];
     unsigned int size;
     int64_t i, sync;
@@ -1110,7 +1110,7 @@ resync:
 static int avi_read_idx1(AVFormatContext *s, int size)
 {
     AVIContext *avi = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int nb_index_entries, i;
     AVStream *st;
     AVIStream *ast;
@@ -1192,7 +1192,7 @@ static int guess_ni_flag(AVFormatContext *s){
 static int avi_load_index(AVFormatContext *s)
 {
     AVIContext *avi = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     uint32_t tag, size;
     int64_t pos= url_ftell(pb);
     int ret = -1;
diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index 178c22b..7844244 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -63,7 +63,7 @@ static inline AVIIentry* avi_get_ientry(AVIIndex* idx, int ent_id)
     return &idx->cluster[cl][id];
 }
 
-static int64_t avi_start_new_riff(AVFormatContext *s, ByteIOContext *pb,
+static int64_t avi_start_new_riff(AVFormatContext *s, AVIOContext *pb,
                                   const char* riff_tag, const char* list_tag)
 {
     AVIContext *avi= s->priv_data;
@@ -102,7 +102,7 @@ static char* avi_stream2fourcc(char* tag, int index, enum AVMediaType type)
     return tag;
 }
 
-static void avi_write_info_tag(ByteIOContext *pb, const char *tag, const char *str)
+static void avi_write_info_tag(AVIOContext *pb, const char *tag, const char *str)
 {
     int len = strlen(str);
     if (len > 0) {
@@ -117,7 +117,7 @@ static void avi_write_info_tag(ByteIOContext *pb, const char *tag, const char *s
 
 static int avi_write_counters(AVFormatContext* s, int riff_id)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVIContext *avi = s->priv_data;
     int n, au_byterate, au_ssize, au_scale, nb_frames = 0;
     int64_t file_size;
@@ -152,7 +152,7 @@ static int avi_write_counters(AVFormatContext* s, int riff_id)
 static int avi_write_header(AVFormatContext *s)
 {
     AVIContext *avi = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int bitrate, n, i, nb_frames, au_byterate, au_ssize, au_scale;
     AVCodecContext *stream, *video_enc;
     int64_t list1, list2, strh, strf;
@@ -393,7 +393,7 @@ static int avi_write_header(AVFormatContext *s)
 
 static int avi_write_ix(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVIContext *avi = s->priv_data;
     char tag[5];
     char ix_tag[] = "ix00";
@@ -451,7 +451,7 @@ static int avi_write_ix(AVFormatContext *s)
 
 static int avi_write_idx1(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVIContext *avi = s->priv_data;
     int64_t idx_chunk;
     int i;
@@ -503,7 +503,7 @@ static int avi_write_idx1(AVFormatContext *s)
 static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     AVIContext *avi = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned char tag[5];
     unsigned int flags=0;
     const int stream_index= pkt->stream_index;
@@ -578,7 +578,7 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
 static int avi_write_trailer(AVFormatContext *s)
 {
     AVIContext *avi = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int res = 0;
     int i, j, n, nb_frames;
     int64_t file_size;
diff --git a/libavformat/avio.h b/libavformat/avio.h
index b8a9343..0189f8a 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -334,7 +334,7 @@ int av_register_protocol2(URLProtocol *protocol, int size);
  * New fields can be added to the end with minor version bumps.
  * Removal, reordering and changes to existing fields require a major
  * version bump.
- * sizeof(ByteIOContext) must not be used outside libav*.
+ * sizeof(AVIOContext) must not be used outside libav*.
  */
 typedef struct {
     unsigned char *buffer;
@@ -357,9 +357,13 @@ typedef struct {
     int (*read_pause)(void *opaque, int pause);
     int64_t (*read_seek)(void *opaque, int stream_index,
                          int64_t timestamp, int flags);
-} ByteIOContext;
+} AVIOContext;
 
-int init_put_byte(ByteIOContext *s,
+#if FF_API_OLD_AVIO
+typedef AVIOContext ByteIOContext attribute_deprecated;
+#endif
+
+int init_put_byte(AVIOContext *s,
                   unsigned char *buffer,
                   int buffer_size,
                   int write_flag,
@@ -367,7 +371,7 @@ int init_put_byte(ByteIOContext *s,
                   int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
                   int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
                   int64_t (*seek)(void *opaque, int64_t offset, int whence));
-ByteIOContext *av_alloc_put_byte(
+AVIOContext *av_alloc_put_byte(
                   unsigned char *buffer,
                   int buffer_size,
                   int write_flag,
@@ -382,90 +386,90 @@ ByteIOContext *av_alloc_put_byte(
  * @deprecated use the avio_ -prefixed functions instead.
  * @{
  */
-attribute_deprecated void put_byte(ByteIOContext *s, int b);
-attribute_deprecated void put_nbyte(ByteIOContext *s, int b, int count);
-attribute_deprecated void put_buffer(ByteIOContext *s, const unsigned char *buf, int size);
-attribute_deprecated void put_le64(ByteIOContext *s, uint64_t val);
-attribute_deprecated void put_be64(ByteIOContext *s, uint64_t val);
-attribute_deprecated void put_le32(ByteIOContext *s, unsigned int val);
-attribute_deprecated void put_be32(ByteIOContext *s, unsigned int val);
-attribute_deprecated void put_le24(ByteIOContext *s, unsigned int val);
-attribute_deprecated void put_be24(ByteIOContext *s, unsigned int val);
-attribute_deprecated void put_le16(ByteIOContext *s, unsigned int val);
-attribute_deprecated void put_be16(ByteIOContext *s, unsigned int val);
-attribute_deprecated void put_tag(ByteIOContext *s, const char *tag);
-
-attribute_deprecated int          get_buffer(ByteIOContext *s, unsigned char *buf, int size);
-attribute_deprecated int          get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size);
-attribute_deprecated int          get_byte(ByteIOContext *s);
-attribute_deprecated unsigned int get_le16(ByteIOContext *s);
-attribute_deprecated unsigned int get_le24(ByteIOContext *s);
-attribute_deprecated unsigned int get_le32(ByteIOContext *s);
-attribute_deprecated uint64_t     get_le64(ByteIOContext *s);
-attribute_deprecated unsigned int get_be16(ByteIOContext *s);
-attribute_deprecated unsigned int get_be24(ByteIOContext *s);
-attribute_deprecated unsigned int get_be32(ByteIOContext *s);
-attribute_deprecated uint64_t     get_be64(ByteIOContext *s);
+attribute_deprecated void put_byte(AVIOContext *s, int b);
+attribute_deprecated void put_nbyte(AVIOContext *s, int b, int count);
+attribute_deprecated void put_buffer(AVIOContext *s, const unsigned char *buf, int size);
+attribute_deprecated void put_le64(AVIOContext *s, uint64_t val);
+attribute_deprecated void put_be64(AVIOContext *s, uint64_t val);
+attribute_deprecated void put_le32(AVIOContext *s, unsigned int val);
+attribute_deprecated void put_be32(AVIOContext *s, unsigned int val);
+attribute_deprecated void put_le24(AVIOContext *s, unsigned int val);
+attribute_deprecated void put_be24(AVIOContext *s, unsigned int val);
+attribute_deprecated void put_le16(AVIOContext *s, unsigned int val);
+attribute_deprecated void put_be16(AVIOContext *s, unsigned int val);
+attribute_deprecated void put_tag(AVIOContext *s, const char *tag);
+
+attribute_deprecated int          get_buffer(AVIOContext *s, unsigned char *buf, int size);
+attribute_deprecated int          get_partial_buffer(AVIOContext *s, unsigned char *buf, int size);
+attribute_deprecated int          get_byte(AVIOContext *s);
+attribute_deprecated unsigned int get_le16(AVIOContext *s);
+attribute_deprecated unsigned int get_le24(AVIOContext *s);
+attribute_deprecated unsigned int get_le32(AVIOContext *s);
+attribute_deprecated uint64_t     get_le64(AVIOContext *s);
+attribute_deprecated unsigned int get_be16(AVIOContext *s);
+attribute_deprecated unsigned int get_be24(AVIOContext *s);
+attribute_deprecated unsigned int get_be32(AVIOContext *s);
+attribute_deprecated uint64_t     get_be64(AVIOContext *s);
 /**
  * @}
  */
 #endif
 
-void avio_put_byte(  ByteIOContext *s, int b);
-void avio_put_nbyte( ByteIOContext *s, int b, int count);
-void avio_put_buffer(ByteIOContext *s, const unsigned char *buf, int size);
-void avio_put_le64(  ByteIOContext *s, uint64_t val);
-void avio_put_be64(  ByteIOContext *s, uint64_t val);
-void avio_put_le32(  ByteIOContext *s, unsigned int val);
-void avio_put_be32(  ByteIOContext *s, unsigned int val);
-void avio_put_le24(  ByteIOContext *s, unsigned int val);
-void avio_put_be24(  ByteIOContext *s, unsigned int val);
-void avio_put_le16(  ByteIOContext *s, unsigned int val);
-void avio_put_be16(  ByteIOContext *s, unsigned int val);
-void avio_put_tag(   ByteIOContext *s, const char *tag);
+void avio_put_byte(  AVIOContext *s, int b);
+void avio_put_nbyte( AVIOContext *s, int b, int count);
+void avio_put_buffer(AVIOContext *s, const unsigned char *buf, int size);
+void avio_put_le64(  AVIOContext *s, uint64_t val);
+void avio_put_be64(  AVIOContext *s, uint64_t val);
+void avio_put_le32(  AVIOContext *s, unsigned int val);
+void avio_put_be32(  AVIOContext *s, unsigned int val);
+void avio_put_le24(  AVIOContext *s, unsigned int val);
+void avio_put_be24(  AVIOContext *s, unsigned int val);
+void avio_put_le16(  AVIOContext *s, unsigned int val);
+void avio_put_be16(  AVIOContext *s, unsigned int val);
+void avio_put_tag(   AVIOContext *s, const char *tag);
 
 #if FF_API_OLD_AVIO
-attribute_deprecated void put_strz(ByteIOContext *s, const char *buf);
+attribute_deprecated void put_strz(AVIOContext *s, const char *buf);
 #endif
 
 /**
  * Write a NULL-terminated string.
  * @return number of bytes written.
  */
-int avio_put_str(ByteIOContext *s, const char *str);
+int avio_put_str(AVIOContext *s, const char *str);
 
 /**
  * Convert an UTF-8 string to UTF-16LE and write it.
  * @return number of bytes written.
  */
-int avio_put_str16le(ByteIOContext *s, const char *str);
+int avio_put_str16le(AVIOContext *s, const char *str);
 
 
 /**
- * Read size bytes from ByteIOContext into buf.
+ * Read size bytes from AVIOContext into buf.
  * @return number of bytes read or AVERROR
  */
-int avio_get_buffer(ByteIOContext *s, unsigned char *buf, int size);
+int avio_get_buffer(AVIOContext *s, unsigned char *buf, int size);
 
 /**
- * Read size bytes from ByteIOContext into buf.
+ * Read size bytes from AVIOContext into buf.
  * This reads at most 1 packet. If that is not enough fewer bytes will be
  * returned.
  * @return number of bytes read or AVERROR
  */
-int avio_get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size);
+int avio_get_partial_buffer(AVIOContext *s, unsigned char *buf, int size);
 
 /** @note return 0 if EOF, so you cannot use it if EOF handling is
     necessary */
-int          avio_get_byte(ByteIOContext *s);
-unsigned int avio_get_le16(ByteIOContext *s);
-unsigned int avio_get_le24(ByteIOContext *s);
-unsigned int avio_get_le32(ByteIOContext *s);
-uint64_t     avio_get_le64(ByteIOContext *s);
-unsigned int avio_get_be16(ByteIOContext *s);
-unsigned int avio_get_be24(ByteIOContext *s);
-unsigned int avio_get_be32(ByteIOContext *s);
-uint64_t     avio_get_be64(ByteIOContext *s);
+int          avio_get_byte(AVIOContext *s);
+unsigned int avio_get_le16(AVIOContext *s);
+unsigned int avio_get_le24(AVIOContext *s);
+unsigned int avio_get_le32(AVIOContext *s);
+uint64_t     avio_get_le64(AVIOContext *s);
+unsigned int avio_get_be16(AVIOContext *s);
+unsigned int avio_get_be24(AVIOContext *s);
+unsigned int avio_get_be32(AVIOContext *s);
+uint64_t     avio_get_be64(AVIOContext *s);
 
 /**
  * Read a UTF-16 string from pb and convert it to UTF-8.
@@ -473,127 +477,127 @@ uint64_t     avio_get_be64(ByteIOContext *s);
  * encountered or maxlen bytes have been read.
  * @return number of bytes read (is always <= maxlen)
  */
-int avio_get_str16le(ByteIOContext *pb, int maxlen, char *buf, int buflen);
-int avio_get_str16be(ByteIOContext *pb, int maxlen, char *buf, int buflen);
+int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen);
+int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
 
-char *get_strz(ByteIOContext *s, char *buf, int maxlen);
+char *get_strz(AVIOContext *s, char *buf, int maxlen);
 
 /**
- * fseek() equivalent for ByteIOContext.
+ * fseek() equivalent for AVIOContext.
  * @return new position or AVERROR.
  */
-int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence);
+int64_t url_fseek(AVIOContext *s, int64_t offset, int whence);
 
 /**
  * Skip given number of bytes forward.
  * @param offset number of bytes
  * @return 0 on success, <0 on error
  */
-int url_fskip(ByteIOContext *s, int64_t offset);
+int url_fskip(AVIOContext *s, int64_t offset);
 
 /**
- * ftell() equivalent for ByteIOContext.
+ * ftell() equivalent for AVIOContext.
  * @return position or AVERROR.
  */
-int64_t url_ftell(ByteIOContext *s);
+int64_t url_ftell(AVIOContext *s);
 
 /**
  * Get the filesize.
  * @return filesize or AVERROR
  */
-int64_t url_fsize(ByteIOContext *s);
+int64_t url_fsize(AVIOContext *s);
 
 /**
- * feof() equivalent for ByteIOContext.
+ * feof() equivalent for AVIOContext.
  * @return non zero if and only if end of file
  */
-int url_feof(ByteIOContext *s);
+int url_feof(AVIOContext *s);
 
-int url_ferror(ByteIOContext *s);
+int url_ferror(AVIOContext *s);
 
-int av_url_read_fpause(ByteIOContext *h, int pause);
-int64_t av_url_read_fseek(ByteIOContext *h, int stream_index,
+int av_url_read_fpause(AVIOContext *h, int pause);
+int64_t av_url_read_fseek(AVIOContext *h, int stream_index,
                           int64_t timestamp, int flags);
 
 #define URL_EOF (-1)
 /** @note return URL_EOF (-1) if EOF */
-int url_fgetc(ByteIOContext *s);
+int url_fgetc(AVIOContext *s);
 
 /** @warning currently size is limited */
 #ifdef __GNUC__
-int url_fprintf(ByteIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
+int url_fprintf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
 #else
-int url_fprintf(ByteIOContext *s, const char *fmt, ...);
+int url_fprintf(AVIOContext *s, const char *fmt, ...);
 #endif
 
 /** @note unlike fgets, the EOL character is not returned and a whole
     line is parsed. return NULL if first char read was EOF */
-char *url_fgets(ByteIOContext *s, char *buf, int buf_size);
+char *url_fgets(AVIOContext *s, char *buf, int buf_size);
 
-void put_flush_packet(ByteIOContext *s);
+void put_flush_packet(AVIOContext *s);
 
-uint64_t ff_get_v(ByteIOContext *bc);
+uint64_t ff_get_v(AVIOContext *bc);
 
-static inline int url_is_streamed(ByteIOContext *s)
+static inline int url_is_streamed(AVIOContext *s)
 {
     return s->is_streamed;
 }
 
 /**
- * Create and initialize a ByteIOContext for accessing the
+ * Create and initialize a AVIOContext for accessing the
  * resource referenced by the URLContext h.
  * @note When the URLContext h has been opened in read+write mode, the
- * ByteIOContext can be used only for writing.
+ * AVIOContext can be used only for writing.
  *
- * @param s Used to return the pointer to the created ByteIOContext.
+ * @param s Used to return the pointer to the created AVIOContext.
  * In case of failure the pointed to value is set to NULL.
  * @return 0 in case of success, a negative value corresponding to an
  * AVERROR code in case of failure
  */
-int url_fdopen(ByteIOContext **s, URLContext *h);
+int url_fdopen(AVIOContext **s, URLContext *h);
 
 /** @warning must be called before any I/O */
-int url_setbufsize(ByteIOContext *s, int buf_size);
+int url_setbufsize(AVIOContext *s, int buf_size);
 #if FF_API_URL_RESETBUF
 /** Reset the buffer for reading or writing.
  * @note Will drop any data currently in the buffer without transmitting it.
  * @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY
  *        to set up the buffer for writing. */
-int url_resetbuf(ByteIOContext *s, int flags);
+int url_resetbuf(AVIOContext *s, int flags);
 #endif
 
 /**
- * Rewind the ByteIOContext using the specified buffer containing the first buf_size bytes of the file.
+ * Rewind the AVIOContext using the specified buffer containing the first buf_size bytes of the file.
  * Used after probing to avoid seeking.
  * Joins buf and s->buffer, taking any overlap into consideration.
  * @note s->buffer must overlap with buf or they can't be joined and the function fails
  * @note This function is NOT part of the public API
  *
- * @param s The read-only ByteIOContext to rewind
+ * @param s The read-only AVIOContext to rewind
  * @param buf The probe buffer containing the first buf_size bytes of the file
  * @param buf_size The size of buf
  * @return 0 in case of success, a negative value corresponding to an
  * AVERROR code in case of failure
  */
-int ff_rewind_with_probe_data(ByteIOContext *s, unsigned char *buf, int buf_size);
+int ff_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size);
 
 /**
- * Create and initialize a ByteIOContext for accessing the
+ * Create and initialize a AVIOContext for accessing the
  * resource indicated by url.
  * @note When the resource indicated by url has been opened in
- * read+write mode, the ByteIOContext can be used only for writing.
+ * read+write mode, the AVIOContext can be used only for writing.
  *
- * @param s Used to return the pointer to the created ByteIOContext.
+ * @param s Used to return the pointer to the created AVIOContext.
  * In case of failure the pointed to value is set to NULL.
  * @param flags flags which control how the resource indicated by url
  * is to be opened
  * @return 0 in case of success, a negative value corresponding to an
  * AVERROR code in case of failure
  */
-int url_fopen(ByteIOContext **s, const char *url, int flags);
+int url_fopen(AVIOContext **s, const char *url, int flags);
 
-int url_fclose(ByteIOContext *s);
-URLContext *url_fileno(ByteIOContext *s);
+int url_fclose(AVIOContext *s);
+URLContext *url_fileno(AVIOContext *s);
 
 /**
  * Return the maximum packet size associated to packetized buffered file
@@ -603,12 +607,12 @@ URLContext *url_fileno(ByteIOContext *s);
  * @param s buffered file handle
  * @return maximum packet size in bytes
  */
-int url_fget_max_packet_size(ByteIOContext *s);
+int url_fget_max_packet_size(AVIOContext *s);
 
-int url_open_buf(ByteIOContext **s, uint8_t *buf, int buf_size, int flags);
+int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags);
 
 /** return the written or read size */
-int url_close_buf(ByteIOContext *s);
+int url_close_buf(AVIOContext *s);
 
 /**
  * Open a write only memory stream.
@@ -616,7 +620,7 @@ int url_close_buf(ByteIOContext *s);
  * @param s new IO context
  * @return zero if no error.
  */
-int url_open_dyn_buf(ByteIOContext **s);
+int url_open_dyn_buf(AVIOContext **s);
 
 /**
  * Open a write only packetized memory stream with a maximum packet
@@ -627,7 +631,7 @@ int url_open_dyn_buf(ByteIOContext **s);
  * @param max_packet_size maximum packet size (must be > 0)
  * @return zero if no error.
  */
-int url_open_dyn_packet_buf(ByteIOContext **s, int max_packet_size);
+int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
 
 /**
  * Return the written size and a pointer to the buffer. The buffer
@@ -639,12 +643,12 @@ int url_open_dyn_packet_buf(ByteIOContext **s, int max_packet_size);
  * @param pbuffer pointer to a byte buffer
  * @return the length of the byte buffer
  */
-int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer);
+int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
 
 unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
                                     unsigned int len);
-unsigned long get_checksum(ByteIOContext *s);
-void init_checksum(ByteIOContext *s,
+unsigned long get_checksum(AVIOContext *s);
+void init_checksum(AVIOContext *s,
                    unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
                    unsigned long checksum);
 
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index b815bf5..fc47a0b 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -35,12 +35,12 @@
  */
 #define SHORT_SEEK_THRESHOLD 4096
 
-static void fill_buffer(ByteIOContext *s);
+static void fill_buffer(AVIOContext *s);
 #if !FF_API_URL_RESETBUF
-static int url_resetbuf(ByteIOContext *s, int flags);
+static int url_resetbuf(AVIOContext *s, int flags);
 #endif
 
-int init_put_byte(ByteIOContext *s,
+int init_put_byte(AVIOContext *s,
                   unsigned char *buffer,
                   int buffer_size,
                   int write_flag,
@@ -73,7 +73,7 @@ int init_put_byte(ByteIOContext *s,
     return 0;
 }
 
-ByteIOContext *av_alloc_put_byte(
+AVIOContext *av_alloc_put_byte(
                   unsigned char *buffer,
                   int buffer_size,
                   int write_flag,
@@ -82,13 +82,13 @@ ByteIOContext *av_alloc_put_byte(
                   int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
                   int64_t (*seek)(void *opaque, int64_t offset, int whence))
 {
-    ByteIOContext *s = av_mallocz(sizeof(ByteIOContext));
+    AVIOContext *s = av_mallocz(sizeof(AVIOContext));
     init_put_byte(s, buffer, buffer_size, write_flag, opaque,
                   read_packet, write_packet, seek);
     return s;
 }
 
-static void flush_buffer(ByteIOContext *s)
+static void flush_buffer(AVIOContext *s)
 {
     if (s->buf_ptr > s->buffer) {
         if (s->write_packet && !s->error){
@@ -106,14 +106,14 @@ static void flush_buffer(ByteIOContext *s)
     s->buf_ptr = s->buffer;
 }
 
-void avio_put_byte(ByteIOContext *s, int b)
+void avio_put_byte(AVIOContext *s, int b)
 {
     *(s->buf_ptr)++ = b;
     if (s->buf_ptr >= s->buf_end)
         flush_buffer(s);
 }
 
-void avio_put_nbyte(ByteIOContext *s, int b, int count)
+void avio_put_nbyte(AVIOContext *s, int b, int count)
 {
     while (count > 0) {
         int len = FFMIN(s->buf_end - s->buf_ptr, count);
@@ -127,7 +127,7 @@ void avio_put_nbyte(ByteIOContext *s, int b, int count)
     }
 }
 
-void avio_put_buffer(ByteIOContext *s, const unsigned char *buf, int size)
+void avio_put_buffer(AVIOContext *s, const unsigned char *buf, int size)
 {
     while (size > 0) {
         int len = FFMIN(s->buf_end - s->buf_ptr, size);
@@ -142,13 +142,13 @@ void avio_put_buffer(ByteIOContext *s, const unsigned char *buf, int size)
     }
 }
 
-void put_flush_packet(ByteIOContext *s)
+void put_flush_packet(AVIOContext *s)
 {
     flush_buffer(s);
     s->must_flush = 0;
 }
 
-int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence)
+int64_t url_fseek(AVIOContext *s, int64_t offset, int whence)
 {
     int64_t offset1;
     int64_t pos;
@@ -205,18 +205,18 @@ int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence)
     return offset;
 }
 
-int url_fskip(ByteIOContext *s, int64_t offset)
+int url_fskip(AVIOContext *s, int64_t offset)
 {
     int64_t ret = url_fseek(s, offset, SEEK_CUR);
     return ret < 0 ? ret : 0;
 }
 
-int64_t url_ftell(ByteIOContext *s)
+int64_t url_ftell(AVIOContext *s)
 {
     return url_fseek(s, 0, SEEK_CUR);
 }
 
-int64_t url_fsize(ByteIOContext *s)
+int64_t url_fsize(AVIOContext *s)
 {
     int64_t size;
 
@@ -235,21 +235,21 @@ int64_t url_fsize(ByteIOContext *s)
     return size;
 }
 
-int url_feof(ByteIOContext *s)
+int url_feof(AVIOContext *s)
 {
     if(!s)
         return 0;
     return s->eof_reached;
 }
 
-int url_ferror(ByteIOContext *s)
+int url_ferror(AVIOContext *s)
 {
     if(!s)
         return 0;
     return s->error;
 }
 
-void avio_put_le32(ByteIOContext *s, unsigned int val)
+void avio_put_le32(AVIOContext *s, unsigned int val)
 {
     avio_put_byte(s, val);
     avio_put_byte(s, val >> 8);
@@ -257,7 +257,7 @@ void avio_put_le32(ByteIOContext *s, unsigned int val)
     avio_put_byte(s, val >> 24);
 }
 
-void avio_put_be32(ByteIOContext *s, unsigned int val)
+void avio_put_be32(AVIOContext *s, unsigned int val)
 {
     avio_put_byte(s, val >> 24);
     avio_put_byte(s, val >> 16);
@@ -266,13 +266,13 @@ void avio_put_be32(ByteIOContext *s, unsigned int val)
 }
 
 #if FF_API_OLD_AVIO
-void put_strz(ByteIOContext *s, const char *str)
+void put_strz(AVIOContext *s, const char *str)
 {
     avio_put_str(s, str);
 }
 
 #define PUT(name, type ) \
-    void put_ ##name ( ByteIOContext *s, type val)\
+    void put_ ##name ( AVIOContext *s, type val)\
 {\
     avio_put_ ##name ( s, val );\
 }
@@ -289,17 +289,17 @@ PUT(be64,   uint64_t)
 PUT(tag,    const char *)
 #undef PUT
 
-void put_buffer(ByteIOContext *s, const unsigned char *buf, int size)
+void put_buffer(AVIOContext *s, const unsigned char *buf, int size)
 {
     avio_put_buffer(s, buf, size);
 }
-void put_nbyte(ByteIOContext *s, int b, int count)
+void put_nbyte(AVIOContext *s, int b, int count)
 {
     avio_put_nbyte(s, b, count);
 }
 
 #define GET(name, type) \
-    type get_ ##name(ByteIOContext *s) \
+    type get_ ##name(AVIOContext *s) \
 {\
     return avio_get_ ##name(s);\
 }
@@ -316,17 +316,17 @@ GET(be64, uint64_t)
 
 #undef GET
 
-int get_buffer(ByteIOContext *s, unsigned char *buf, int size)
+int get_buffer(AVIOContext *s, unsigned char *buf, int size)
 {
     return avio_get_buffer(s, buf, size);
 }
-int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size)
+int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size)
 {
     return avio_get_partial_buffer(s, buf, size);
 }
 #endif
 
-int avio_put_str(ByteIOContext *s, const char *str)
+int avio_put_str(AVIOContext *s, const char *str)
 {
     int len = 1;
     if (str) {
@@ -337,7 +337,7 @@ int avio_put_str(ByteIOContext *s, const char *str)
     return len;
 }
 
-int avio_put_str16le(ByteIOContext *s, const char *str)
+int avio_put_str16le(AVIOContext *s, const char *str)
 {
     const uint8_t *q = str;
     int ret = 0;
@@ -363,7 +363,7 @@ int ff_get_v_length(uint64_t val){
     return i;
 }
 
-void ff_put_v(ByteIOContext *bc, uint64_t val){
+void ff_put_v(AVIOContext *bc, uint64_t val){
     int i= ff_get_v_length(val);
 
     while(--i>0)
@@ -372,43 +372,43 @@ void ff_put_v(ByteIOContext *bc, uint64_t val){
     avio_put_byte(bc, val&127);
 }
 
-void avio_put_le64(ByteIOContext *s, uint64_t val)
+void avio_put_le64(AVIOContext *s, uint64_t val)
 {
     avio_put_le32(s, (uint32_t)(val & 0xffffffff));
     avio_put_le32(s, (uint32_t)(val >> 32));
 }
 
-void avio_put_be64(ByteIOContext *s, uint64_t val)
+void avio_put_be64(AVIOContext *s, uint64_t val)
 {
     avio_put_be32(s, (uint32_t)(val >> 32));
     avio_put_be32(s, (uint32_t)(val & 0xffffffff));
 }
 
-void avio_put_le16(ByteIOContext *s, unsigned int val)
+void avio_put_le16(AVIOContext *s, unsigned int val)
 {
     avio_put_byte(s, val);
     avio_put_byte(s, val >> 8);
 }
 
-void avio_put_be16(ByteIOContext *s, unsigned int val)
+void avio_put_be16(AVIOContext *s, unsigned int val)
 {
     avio_put_byte(s, val >> 8);
     avio_put_byte(s, val);
 }
 
-void avio_put_le24(ByteIOContext *s, unsigned int val)
+void avio_put_le24(AVIOContext *s, unsigned int val)
 {
     avio_put_le16(s, val & 0xffff);
     avio_put_byte(s, val >> 16);
 }
 
-void avio_put_be24(ByteIOContext *s, unsigned int val)
+void avio_put_be24(AVIOContext *s, unsigned int val)
 {
     avio_put_be16(s, val >> 8);
     avio_put_byte(s, val);
 }
 
-void avio_put_tag(ByteIOContext *s, const char *tag)
+void avio_put_tag(AVIOContext *s, const char *tag)
 {
     while (*tag) {
         avio_put_byte(s, *tag++);
@@ -417,7 +417,7 @@ void avio_put_tag(ByteIOContext *s, const char *tag)
 
 /* Input stream */
 
-static void fill_buffer(ByteIOContext *s)
+static void fill_buffer(AVIOContext *s)
 {
     uint8_t *dst= !s->max_packet_size && s->buf_end - s->buffer < s->buffer_size ? s->buf_ptr : s->buffer;
     int len= s->buffer_size - (dst - s->buffer);
@@ -464,14 +464,14 @@ unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
     return av_crc(av_crc_get_table(AV_CRC_32_IEEE), checksum, buf, len);
 }
 
-unsigned long get_checksum(ByteIOContext *s)
+unsigned long get_checksum(AVIOContext *s)
 {
     s->checksum= s->update_checksum(s->checksum, s->checksum_ptr, s->buf_ptr - s->checksum_ptr);
     s->update_checksum= NULL;
     return s->checksum;
 }
 
-void init_checksum(ByteIOContext *s,
+void init_checksum(AVIOContext *s,
                    unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
                    unsigned long checksum)
 {
@@ -483,7 +483,7 @@ void init_checksum(ByteIOContext *s,
 }
 
 /* XXX: put an inline version */
-int avio_get_byte(ByteIOContext *s)
+int avio_get_byte(AVIOContext *s)
 {
     if (s->buf_ptr >= s->buf_end)
         fill_buffer(s);
@@ -492,7 +492,7 @@ int avio_get_byte(ByteIOContext *s)
     return 0;
 }
 
-int url_fgetc(ByteIOContext *s)
+int url_fgetc(AVIOContext *s)
 {
     if (s->buf_ptr >= s->buf_end)
         fill_buffer(s);
@@ -501,7 +501,7 @@ int url_fgetc(ByteIOContext *s)
     return URL_EOF;
 }
 
-int avio_get_buffer(ByteIOContext *s, unsigned char *buf, int size)
+int avio_get_buffer(AVIOContext *s, unsigned char *buf, int size)
 {
     int len, size1;
 
@@ -548,7 +548,7 @@ int avio_get_buffer(ByteIOContext *s, unsigned char *buf, int size)
     return size1 - size;
 }
 
-int avio_get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size)
+int avio_get_partial_buffer(AVIOContext *s, unsigned char *buf, int size)
 {
     int len;
 
@@ -571,7 +571,7 @@ int avio_get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size)
     return len;
 }
 
-unsigned int avio_get_le16(ByteIOContext *s)
+unsigned int avio_get_le16(AVIOContext *s)
 {
     unsigned int val;
     val = avio_get_byte(s);
@@ -579,7 +579,7 @@ unsigned int avio_get_le16(ByteIOContext *s)
     return val;
 }
 
-unsigned int avio_get_le24(ByteIOContext *s)
+unsigned int avio_get_le24(AVIOContext *s)
 {
     unsigned int val;
     val = avio_get_le16(s);
@@ -587,7 +587,7 @@ unsigned int avio_get_le24(ByteIOContext *s)
     return val;
 }
 
-unsigned int avio_get_le32(ByteIOContext *s)
+unsigned int avio_get_le32(AVIOContext *s)
 {
     unsigned int val;
     val = avio_get_le16(s);
@@ -595,7 +595,7 @@ unsigned int avio_get_le32(ByteIOContext *s)
     return val;
 }
 
-uint64_t avio_get_le64(ByteIOContext *s)
+uint64_t avio_get_le64(AVIOContext *s)
 {
     uint64_t val;
     val = (uint64_t)avio_get_le32(s);
@@ -603,7 +603,7 @@ uint64_t avio_get_le64(ByteIOContext *s)
     return val;
 }
 
-unsigned int avio_get_be16(ByteIOContext *s)
+unsigned int avio_get_be16(AVIOContext *s)
 {
     unsigned int val;
     val = avio_get_byte(s) << 8;
@@ -611,14 +611,14 @@ unsigned int avio_get_be16(ByteIOContext *s)
     return val;
 }
 
-unsigned int avio_get_be24(ByteIOContext *s)
+unsigned int avio_get_be24(AVIOContext *s)
 {
     unsigned int val;
     val = avio_get_be16(s) << 8;
     val |= avio_get_byte(s);
     return val;
 }
-unsigned int avio_get_be32(ByteIOContext *s)
+unsigned int avio_get_be32(AVIOContext *s)
 {
     unsigned int val;
     val = avio_get_be16(s) << 16;
@@ -626,7 +626,7 @@ unsigned int avio_get_be32(ByteIOContext *s)
     return val;
 }
 
-char *get_strz(ByteIOContext *s, char *buf, int maxlen)
+char *get_strz(AVIOContext *s, char *buf, int maxlen)
 {
     int i = 0;
     char c;
@@ -641,7 +641,7 @@ char *get_strz(ByteIOContext *s, char *buf, int maxlen)
     return buf;
 }
 
-int ff_get_line(ByteIOContext *s, char *buf, int maxlen)
+int ff_get_line(AVIOContext *s, char *buf, int maxlen)
 {
     int i = 0;
     char c;
@@ -657,7 +657,7 @@ int ff_get_line(ByteIOContext *s, char *buf, int maxlen)
 }
 
 #define GET_STR16(type, read) \
-    int avio_get_str16 ##type(ByteIOContext *pb, int maxlen, char *buf, int buflen)\
+    int avio_get_str16 ##type(AVIOContext *pb, int maxlen, char *buf, int buflen)\
 {\
     char* q = buf;\
     int ret = 0;\
@@ -678,7 +678,7 @@ GET_STR16(be, avio_get_be16)
 
 #undef GET_STR16
 
-uint64_t avio_get_be64(ByteIOContext *s)
+uint64_t avio_get_be64(AVIOContext *s)
 {
     uint64_t val;
     val = (uint64_t)avio_get_be32(s) << 32;
@@ -686,7 +686,7 @@ uint64_t avio_get_be64(ByteIOContext *s)
     return val;
 }
 
-uint64_t ff_get_v(ByteIOContext *bc){
+uint64_t ff_get_v(AVIOContext *bc){
     uint64_t val = 0;
     int tmp;
 
@@ -697,7 +697,7 @@ uint64_t ff_get_v(ByteIOContext *bc){
     return val;
 }
 
-int url_fdopen(ByteIOContext **s, URLContext *h)
+int url_fdopen(AVIOContext **s, URLContext *h)
 {
     uint8_t *buffer;
     int buffer_size, max_packet_size;
@@ -712,7 +712,7 @@ int url_fdopen(ByteIOContext **s, URLContext *h)
     if (!buffer)
         return AVERROR(ENOMEM);
 
-    *s = av_mallocz(sizeof(ByteIOContext));
+    *s = av_mallocz(sizeof(AVIOContext));
     if(!*s) {
         av_free(buffer);
         return AVERROR(ENOMEM);
@@ -734,7 +734,7 @@ int url_fdopen(ByteIOContext **s, URLContext *h)
     return 0;
 }
 
-int url_setbufsize(ByteIOContext *s, int buf_size)
+int url_setbufsize(AVIOContext *s, int buf_size)
 {
     uint8_t *buffer;
     buffer = av_malloc(buf_size);
@@ -750,9 +750,9 @@ int url_setbufsize(ByteIOContext *s, int buf_size)
 }
 
 #if FF_API_URL_RESETBUF
-int url_resetbuf(ByteIOContext *s, int flags)
+int url_resetbuf(AVIOContext *s, int flags)
 #else
-static int url_resetbuf(ByteIOContext *s, int flags)
+static int url_resetbuf(AVIOContext *s, int flags)
 #endif
 {
 #if FF_API_URL_RESETBUF
@@ -772,7 +772,7 @@ static int url_resetbuf(ByteIOContext *s, int flags)
     return 0;
 }
 
-int ff_rewind_with_probe_data(ByteIOContext *s, unsigned char *buf, int buf_size)
+int ff_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size)
 {
     int64_t buffer_start;
     int buffer_size;
@@ -811,7 +811,7 @@ int ff_rewind_with_probe_data(ByteIOContext *s, unsigned char *buf, int buf_size
     return 0;
 }
 
-int url_fopen(ByteIOContext **s, const char *filename, int flags)
+int url_fopen(AVIOContext **s, const char *filename, int flags)
 {
     URLContext *h;
     int err;
@@ -827,7 +827,7 @@ int url_fopen(ByteIOContext **s, const char *filename, int flags)
     return 0;
 }
 
-int url_fclose(ByteIOContext *s)
+int url_fclose(AVIOContext *s)
 {
     URLContext *h = s->opaque;
 
@@ -836,13 +836,13 @@ int url_fclose(ByteIOContext *s)
     return url_close(h);
 }
 
-URLContext *url_fileno(ByteIOContext *s)
+URLContext *url_fileno(AVIOContext *s)
 {
     return s->opaque;
 }
 
 #if CONFIG_MUXERS
-int url_fprintf(ByteIOContext *s, const char *fmt, ...)
+int url_fprintf(AVIOContext *s, const char *fmt, ...)
 {
     va_list ap;
     char buf[4096];
@@ -856,7 +856,7 @@ int url_fprintf(ByteIOContext *s, const char *fmt, ...)
 }
 #endif //CONFIG_MUXERS
 
-char *url_fgets(ByteIOContext *s, char *buf, int buf_size)
+char *url_fgets(AVIOContext *s, char *buf, int buf_size)
 {
     int c;
     char *q;
@@ -877,19 +877,19 @@ char *url_fgets(ByteIOContext *s, char *buf, int buf_size)
     return buf;
 }
 
-int url_fget_max_packet_size(ByteIOContext *s)
+int url_fget_max_packet_size(AVIOContext *s)
 {
     return s->max_packet_size;
 }
 
-int av_url_read_fpause(ByteIOContext *s, int pause)
+int av_url_read_fpause(AVIOContext *s, int pause)
 {
     if (!s->read_pause)
         return AVERROR(ENOSYS);
     return s->read_pause(s->opaque, pause);
 }
 
-int64_t av_url_read_fseek(ByteIOContext *s, int stream_index,
+int64_t av_url_read_fseek(AVIOContext *s, int stream_index,
                           int64_t timestamp, int flags)
 {
     URLContext *h = s->opaque;
@@ -913,10 +913,10 @@ int64_t av_url_read_fseek(ByteIOContext *s, int stream_index,
  * back to the server even if CONFIG_MUXERS is false. */
 #if CONFIG_MUXERS || CONFIG_NETWORK
 /* buffer handling */
-int url_open_buf(ByteIOContext **s, uint8_t *buf, int buf_size, int flags)
+int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags)
 {
     int ret;
-    *s = av_mallocz(sizeof(ByteIOContext));
+    *s = av_mallocz(sizeof(AVIOContext));
     if(!*s)
         return AVERROR(ENOMEM);
     ret = init_put_byte(*s, buf, buf_size,
@@ -927,7 +927,7 @@ int url_open_buf(ByteIOContext **s, uint8_t *buf, int buf_size, int flags)
     return ret;
 }
 
-int url_close_buf(ByteIOContext *s)
+int url_close_buf(AVIOContext *s)
 {
     put_flush_packet(s);
     return s->buf_ptr - s->buffer;
@@ -1001,7 +1001,7 @@ static int64_t dyn_buf_seek(void *opaque, int64_t offset, int whence)
     return 0;
 }
 
-static int url_open_dyn_buf_internal(ByteIOContext **s, int max_packet_size)
+static int url_open_dyn_buf_internal(AVIOContext **s, int max_packet_size)
 {
     DynBuffer *d;
     int ret;
@@ -1012,7 +1012,7 @@ static int url_open_dyn_buf_internal(ByteIOContext **s, int max_packet_size)
     d = av_mallocz(sizeof(DynBuffer) + io_buffer_size);
     if (!d)
         return AVERROR(ENOMEM);
-    *s = av_mallocz(sizeof(ByteIOContext));
+    *s = av_mallocz(sizeof(AVIOContext));
     if(!*s) {
         av_free(d);
         return AVERROR(ENOMEM);
@@ -1031,19 +1031,19 @@ static int url_open_dyn_buf_internal(ByteIOContext **s, int max_packet_size)
     return ret;
 }
 
-int url_open_dyn_buf(ByteIOContext **s)
+int url_open_dyn_buf(AVIOContext **s)
 {
     return url_open_dyn_buf_internal(s, 0);
 }
 
-int url_open_dyn_packet_buf(ByteIOContext **s, int max_packet_size)
+int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size)
 {
     if (max_packet_size <= 0)
         return -1;
     return url_open_dyn_buf_internal(s, max_packet_size);
 }
 
-int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer)
+int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
 {
     DynBuffer *d = s->opaque;
     int size;
diff --git a/libavformat/bethsoftvid.c b/libavformat/bethsoftvid.c
index 8ff3681..118ddb1 100644
--- a/libavformat/bethsoftvid.c
+++ b/libavformat/bethsoftvid.c
@@ -60,7 +60,7 @@ static int vid_read_header(AVFormatContext *s,
                             AVFormatParameters *ap)
 {
     BVID_DemuxContext *vid = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *stream;
 
     /* load main header. Contents:
@@ -97,7 +97,7 @@ static int vid_read_header(AVFormatContext *s,
 }
 
 #define BUFFER_PADDING_SIZE 1000
-static int read_frame(BVID_DemuxContext *vid, ByteIOContext *pb, AVPacket *pkt,
+static int read_frame(BVID_DemuxContext *vid, AVIOContext *pb, AVPacket *pkt,
                       uint8_t block_type, AVFormatContext *s, int npixels)
 {
     uint8_t * vidbuf_start = NULL;
@@ -174,7 +174,7 @@ static int vid_read_packet(AVFormatContext *s,
                            AVPacket *pkt)
 {
     BVID_DemuxContext *vid = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned char block_type;
     int audio_length;
     int ret_value;
diff --git a/libavformat/bfi.c b/libavformat/bfi.c
index f8c2690..8743fcb 100644
--- a/libavformat/bfi.c
+++ b/libavformat/bfi.c
@@ -49,7 +49,7 @@ static int bfi_probe(AVProbeData * p)
 static int bfi_read_header(AVFormatContext * s, AVFormatParameters * ap)
 {
     BFIContext *bfi = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *vstream;
     AVStream *astream;
     int fps, chunk_header;
@@ -107,7 +107,7 @@ static int bfi_read_header(AVFormatContext * s, AVFormatParameters * ap)
 static int bfi_read_packet(AVFormatContext * s, AVPacket * pkt)
 {
     BFIContext *bfi = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int ret, audio_offset, video_offset, chunk_size, audio_size = 0;
     if (bfi->nframes == 0 || url_feof(pb)) {
         return AVERROR(EIO);
diff --git a/libavformat/bink.c b/libavformat/bink.c
index 240be89..e5633aa 100644
--- a/libavformat/bink.c
+++ b/libavformat/bink.c
@@ -70,7 +70,7 @@ static int probe(AVProbeData *p)
 static int read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     BinkDemuxContext *bink = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     uint32_t fps_num, fps_den;
     AVStream *vst, *ast;
     unsigned int i;
@@ -177,7 +177,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
 static int read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     BinkDemuxContext *bink = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int ret;
 
     if (bink->current_track < 0) {
diff --git a/libavformat/c93.c b/libavformat/c93.c
index e5c731d..ebe8b33 100644
--- a/libavformat/c93.c
+++ b/libavformat/c93.c
@@ -60,7 +60,7 @@ static int read_header(AVFormatContext *s,
                            AVFormatParameters *ap)
 {
     AVStream *video;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     C93DemuxContext *c93 = s->priv_data;
     int i;
     int framecount = 0;
@@ -105,7 +105,7 @@ static int read_header(AVFormatContext *s,
 
 static int read_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     C93DemuxContext *c93 = s->priv_data;
     C93BlockRecord *br = &c93->block_records[c93->current_block];
     int datasize;
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index 6e1f517..0f77869 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -53,7 +53,7 @@ static int probe(AVProbeData *p)
 /** Read audio description chunk */
 static int read_desc_chunk(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     CaffContext *caf  = s->priv_data;
     AVStream *st;
     int flags;
@@ -93,7 +93,7 @@ static int read_desc_chunk(AVFormatContext *s)
 /** Read magic cookie chunk */
 static int read_kuki_chunk(AVFormatContext *s, int64_t size)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st      = s->streams[0];
 
     if (size < 0 || size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
@@ -144,7 +144,7 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size)
 /** Read packet table chunk */
 static int read_pakt_chunk(AVFormatContext *s, int64_t size)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st      = s->streams[0];
     CaffContext *caf  = s->priv_data;
     int64_t pos = 0, ccount;
@@ -179,7 +179,7 @@ static int read_pakt_chunk(AVFormatContext *s, int64_t size)
 /** Read information chunk */
 static void read_info_chunk(AVFormatContext *s, int64_t size)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned int i;
     unsigned int nb_entries = avio_get_be32(pb);
     for (i = 0; i < nb_entries; i++) {
@@ -194,7 +194,7 @@ static void read_info_chunk(AVFormatContext *s, int64_t size)
 static int read_header(AVFormatContext *s,
                        AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     CaffContext *caf  = s->priv_data;
     AVStream *st;
     uint32_t tag = 0;
@@ -301,7 +301,7 @@ static int read_header(AVFormatContext *s,
 
 static int read_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st      = s->streams[0];
     CaffContext *caf  = s->priv_data;
     int res, pkt_size = 0, pkt_frames = 0;
diff --git a/libavformat/daud.c b/libavformat/daud.c
index b1d9afc..b7482fa 100644
--- a/libavformat/daud.c
+++ b/libavformat/daud.c
@@ -36,7 +36,7 @@ static int daud_header(AVFormatContext *s, AVFormatParameters *ap) {
 }
 
 static int daud_packet(AVFormatContext *s, AVPacket *pkt) {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int ret, size;
     if (url_feof(pb))
         return AVERROR(EIO);
diff --git a/libavformat/dsicin.c b/libavformat/dsicin.c
index b83fbf0..f44b915 100644
--- a/libavformat/dsicin.c
+++ b/libavformat/dsicin.c
@@ -70,7 +70,7 @@ static int cin_probe(AVProbeData *p)
     return AVPROBE_SCORE_MAX;
 }
 
-static int cin_read_file_header(CinDemuxContext *cin, ByteIOContext *pb) {
+static int cin_read_file_header(CinDemuxContext *cin, AVIOContext *pb) {
     CinFileHeader *hdr = &cin->file_header;
 
     if (avio_get_le32(pb) != 0x55AA0000)
@@ -95,7 +95,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap)
     int rc;
     CinDemuxContext *cin = s->priv_data;
     CinFileHeader *hdr = &cin->file_header;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
 
     rc = cin_read_file_header(cin, pb);
@@ -138,7 +138,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap)
     return 0;
 }
 
-static int cin_read_frame_header(CinDemuxContext *cin, ByteIOContext *pb) {
+static int cin_read_frame_header(CinDemuxContext *cin, AVIOContext *pb) {
     CinFrameHeader *hdr = &cin->frame_header;
 
     hdr->video_frame_type = avio_get_byte(pb);
@@ -159,7 +159,7 @@ static int cin_read_frame_header(CinDemuxContext *cin, ByteIOContext *pb) {
 static int cin_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     CinDemuxContext *cin = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     CinFrameHeader *hdr = &cin->frame_header;
     int rc, palette_type, pkt_size;
     int ret;
diff --git a/libavformat/dxa.c b/libavformat/dxa.c
index e2ecaca..be6092d 100644
--- a/libavformat/dxa.c
+++ b/libavformat/dxa.c
@@ -52,7 +52,7 @@ static int dxa_probe(AVProbeData *p)
 
 static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     DXAContext *c = s->priv_data;
     AVStream *st, *ast;
     uint32_t tag;
diff --git a/libavformat/eacdata.c b/libavformat/eacdata.c
index 2f2e907..b9f50d1 100644
--- a/libavformat/eacdata.c
+++ b/libavformat/eacdata.c
@@ -47,7 +47,7 @@ static int cdata_probe(AVProbeData *p)
 static int cdata_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     CdataDemuxContext *cdata = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned int sample_rate, header;
     AVStream *st;
 
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index ee2d95e..4044bf2 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -77,7 +77,7 @@ typedef struct EaDemuxContext {
     int num_samples;
 } EaDemuxContext;
 
-static uint32_t read_arbitary(ByteIOContext *pb) {
+static uint32_t read_arbitary(AVIOContext *pb) {
     uint8_t size, byte;
     int i;
     uint32_t word;
@@ -102,7 +102,7 @@ static int process_audio_header_elements(AVFormatContext *s)
 {
     int inHeader = 1;
     EaDemuxContext *ea = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int compression_type = -1, revision = -1, revision2 = -1;
 
     ea->bytes = 2;
@@ -215,7 +215,7 @@ static int process_audio_header_elements(AVFormatContext *s)
 static int process_audio_header_eacs(AVFormatContext *s)
 {
     EaDemuxContext *ea = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int compression_type;
 
     ea->sample_rate  = ea->big_endian ? avio_get_be32(pb) : avio_get_le32(pb);
@@ -247,7 +247,7 @@ static int process_audio_header_eacs(AVFormatContext *s)
 static int process_audio_header_sead(AVFormatContext *s)
 {
     EaDemuxContext *ea = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     ea->sample_rate  = avio_get_le32(pb);
     ea->bytes        = avio_get_le32(pb);  /* 1=8-bit, 2=16-bit */
@@ -260,7 +260,7 @@ static int process_audio_header_sead(AVFormatContext *s)
 static int process_video_header_mdec(AVFormatContext *s)
 {
     EaDemuxContext *ea = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     url_fskip(pb, 4);
     ea->width  = avio_get_le16(pb);
     ea->height = avio_get_le16(pb);
@@ -272,7 +272,7 @@ static int process_video_header_mdec(AVFormatContext *s)
 static int process_video_header_vp6(AVFormatContext *s)
 {
     EaDemuxContext *ea = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     url_fskip(pb, 16);
     ea->time_base.den = avio_get_le32(pb);
@@ -289,7 +289,7 @@ static int process_video_header_vp6(AVFormatContext *s)
 static int process_ea_header(AVFormatContext *s) {
     uint32_t blockid, size = 0;
     EaDemuxContext *ea = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int i;
 
     for (i=0; i<5 && (!ea->audio_codec || !ea->video_codec); i++) {
@@ -459,7 +459,7 @@ static int ea_read_packet(AVFormatContext *s,
                           AVPacket *pkt)
 {
     EaDemuxContext *ea = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int ret = 0;
     int packet_read = 0;
     unsigned int chunk_type, chunk_size;
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index b87fda5..b2f3016 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -105,7 +105,7 @@ static int ffm_read_data(AVFormatContext *s,
                          uint8_t *buf, int size, int header)
 {
     FFMContext *ffm = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int len, fill_size, size1, frame_offset, id;
 
     size1 = size;
@@ -170,7 +170,7 @@ static int ffm_read_data(AVFormatContext *s,
 static void ffm_seek1(AVFormatContext *s, int64_t pos1)
 {
     FFMContext *ffm = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t pos;
 
     pos = FFMIN(pos1, ffm->file_size - FFM_PACKET_SIZE);
@@ -183,7 +183,7 @@ static void ffm_seek1(AVFormatContext *s, int64_t pos1)
 
 static int64_t get_dts(AVFormatContext *s, int64_t pos)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t dts;
 
     ffm_seek1(s, pos);
@@ -198,7 +198,7 @@ static int64_t get_dts(AVFormatContext *s, int64_t pos)
 static void adjust_write_index(AVFormatContext *s)
 {
     FFMContext *ffm = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t pts;
     //int64_t orig_write_index = ffm->write_index;
     int64_t pos_min, pos_max;
@@ -267,7 +267,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     FFMContext *ffm = s->priv_data;
     AVStream *st;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVCodecContext *codec;
     int i, nb_streams;
     uint32_t tag;
diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c
index 2f3a203..3652b00 100644
--- a/libavformat/ffmenc.c
+++ b/libavformat/ffmenc.c
@@ -27,7 +27,7 @@ static void flush_packet(AVFormatContext *s)
 {
     FFMContext *ffm = s->priv_data;
     int fill_size, h;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     fill_size = ffm->packet_end - ffm->packet_ptr;
     memset(ffm->packet_ptr, 0, fill_size);
@@ -84,7 +84,7 @@ static int ffm_write_header(AVFormatContext *s)
 {
     FFMContext *ffm = s->priv_data;
     AVStream *st;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVCodecContext *codec;
     int bit_rate, i;
 
@@ -228,7 +228,7 @@ static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt)
 
 static int ffm_write_trailer(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     FFMContext *ffm = s->priv_data;
 
     /* flush packets */
diff --git a/libavformat/ffmetadec.c b/libavformat/ffmetadec.c
index dd788cd..e52c4c6 100644
--- a/libavformat/ffmetadec.c
+++ b/libavformat/ffmetadec.c
@@ -30,7 +30,7 @@ static int probe(AVProbeData *p)
     return 0;
 }
 
-static void get_line(ByteIOContext *s, uint8_t *buf, int size)
+static void get_line(AVIOContext *s, uint8_t *buf, int size)
 {
     do {
         uint8_t c;
diff --git a/libavformat/ffmetaenc.c b/libavformat/ffmetaenc.c
index c53c29c..aac04be 100644
--- a/libavformat/ffmetaenc.c
+++ b/libavformat/ffmetaenc.c
@@ -25,7 +25,7 @@
 #include "ffmeta.h"
 
 
-static void write_escape_str(ByteIOContext *s, const uint8_t *str)
+static void write_escape_str(AVIOContext *s, const uint8_t *str)
 {
     const uint8_t *p = str;
 
@@ -37,7 +37,7 @@ static void write_escape_str(ByteIOContext *s, const uint8_t *str)
     }
 }
 
-static void write_tags(ByteIOContext *s, AVMetadata *m)
+static void write_tags(AVIOContext *s, AVMetadata *m)
 {
     AVMetadataTag *t = NULL;
     while ((t = av_metadata_get(m, "", t, AV_METADATA_IGNORE_SUFFIX))) {
diff --git a/libavformat/filmstripdec.c b/libavformat/filmstripdec.c
index bfd1840..0381ece 100644
--- a/libavformat/filmstripdec.c
+++ b/libavformat/filmstripdec.c
@@ -37,7 +37,7 @@ static int read_header(AVFormatContext *s,
                        AVFormatParameters *ap)
 {
     FilmstripDemuxContext *film = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
 
     if (url_is_streamed(s->pb))
diff --git a/libavformat/filmstripenc.c b/libavformat/filmstripenc.c
index 5ff17df..e88f174 100644
--- a/libavformat/filmstripenc.c
+++ b/libavformat/filmstripenc.c
@@ -53,7 +53,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
 static int write_trailer(AVFormatContext *s)
 {
     FilmstripMuxContext *film = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st = s->streams[0];
     int i;
 
diff --git a/libavformat/flacenc.c b/libavformat/flacenc.c
index de05972..f3980c9 100644
--- a/libavformat/flacenc.c
+++ b/libavformat/flacenc.c
@@ -27,7 +27,7 @@
 #include "libavcodec/bytestream.h"
 
 
-static int flac_write_block_padding(ByteIOContext *pb, unsigned int n_padding_bytes,
+static int flac_write_block_padding(AVIOContext *pb, unsigned int n_padding_bytes,
                                     int last_block)
 {
     avio_put_byte(pb, last_block ? 0x81 : 0x01);
@@ -39,7 +39,7 @@ static int flac_write_block_padding(ByteIOContext *pb, unsigned int n_padding_by
     return 0;
 }
 
-static int flac_write_block_comment(ByteIOContext *pb, AVMetadata **m,
+static int flac_write_block_comment(AVIOContext *pb, AVMetadata **m,
                                     int last_block, int bitexact)
 {
     const char *vendor = bitexact ? "ffmpeg" : LIBAVFORMAT_IDENT;
@@ -90,7 +90,7 @@ static int flac_write_header(struct AVFormatContext *s)
 
 static int flac_write_trailer(struct AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     uint8_t *streaminfo;
     enum FLACExtradataFormat format;
     int64_t file_size;
diff --git a/libavformat/flacenc.h b/libavformat/flacenc.h
index 8ad1c26..e83ee32 100644
--- a/libavformat/flacenc.h
+++ b/libavformat/flacenc.h
@@ -26,7 +26,7 @@
 #include "libavcodec/bytestream.h"
 #include "avformat.h"
 
-int ff_flac_write_header(ByteIOContext *pb, AVCodecContext *codec,
+int ff_flac_write_header(AVIOContext *pb, AVCodecContext *codec,
                          int last_block);
 
 #endif /* AVFORMAT_FLACENC_H */
diff --git a/libavformat/flacenc_header.c b/libavformat/flacenc_header.c
index 2465fc2..b20b6d4 100644
--- a/libavformat/flacenc_header.c
+++ b/libavformat/flacenc_header.c
@@ -24,7 +24,7 @@
 #include "avformat.h"
 #include "flacenc.h"
 
-int ff_flac_write_header(ByteIOContext *pb, AVCodecContext *codec,
+int ff_flac_write_header(AVIOContext *pb, AVCodecContext *codec,
                          int last_block)
 {
     uint8_t header[8] = {
diff --git a/libavformat/flic.c b/libavformat/flic.c
index 62ce554..8c982c51 100644
--- a/libavformat/flic.c
+++ b/libavformat/flic.c
@@ -86,7 +86,7 @@ static int flic_read_header(AVFormatContext *s,
                             AVFormatParameters *ap)
 {
     FlicDemuxContext *flic = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned char header[FLIC_HEADER_SIZE];
     AVStream *st, *ast;
     int speed;
@@ -198,7 +198,7 @@ static int flic_read_packet(AVFormatContext *s,
                             AVPacket *pkt)
 {
     FlicDemuxContext *flic = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int packet_read = 0;
     unsigned int size;
     int magic;
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 4eef6da..0810ef1 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -110,7 +110,7 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream, int flv_co
     return 0;
 }
 
-static int amf_get_string(ByteIOContext *ioc, char *buffer, int buffsize) {
+static int amf_get_string(AVIOContext *ioc, char *buffer, int buffsize) {
     int length = avio_get_be16(ioc);
     if(length >= buffsize) {
         url_fskip(ioc, length);
@@ -126,7 +126,7 @@ static int amf_get_string(ByteIOContext *ioc, char *buffer, int buffsize) {
 
 static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vstream, const char *key, int64_t max_pos, int depth) {
     AVCodecContext *acodec, *vcodec;
-    ByteIOContext *ioc;
+    AVIOContext *ioc;
     AMFDataType amf_type;
     char str_val[256];
     double num_val;
@@ -213,7 +213,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst
 static int flv_read_metabody(AVFormatContext *s, int64_t next_pos) {
     AMFDataType type;
     AVStream *stream, *astream, *vstream;
-    ByteIOContext *ioc;
+    AVIOContext *ioc;
     int i;
     char buffer[11]; //only needs to hold the string "onMetaData". Anything longer is something we don't want.
 
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 24f75b2..9d30f59 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -139,14 +139,14 @@ static int get_audio_flags(AVCodecContext *enc){
     return flags;
 }
 
-static void put_amf_string(ByteIOContext *pb, const char *str)
+static void put_amf_string(AVIOContext *pb, const char *str)
 {
     size_t len = strlen(str);
     avio_put_be16(pb, len);
     avio_put_buffer(pb, str, len);
 }
 
-static void put_avc_eos_tag(ByteIOContext *pb, unsigned ts) {
+static void put_avc_eos_tag(AVIOContext *pb, unsigned ts) {
     avio_put_byte(pb, FLV_TAG_TYPE_VIDEO);
     avio_put_be24(pb, 5);  /* Tag Data Size */
     avio_put_be24(pb, ts);  /* lower 24 bits of timestamp in ms*/
@@ -158,20 +158,20 @@ static void put_avc_eos_tag(ByteIOContext *pb, unsigned ts) {
     avio_put_be32(pb, 16);  /* Size of FLV tag */
 }
 
-static void put_amf_double(ByteIOContext *pb, double d)
+static void put_amf_double(AVIOContext *pb, double d)
 {
     avio_put_byte(pb, AMF_DATA_TYPE_NUMBER);
     avio_put_be64(pb, av_dbl2int(d));
 }
 
-static void put_amf_bool(ByteIOContext *pb, int b) {
+static void put_amf_bool(AVIOContext *pb, int b) {
     avio_put_byte(pb, AMF_DATA_TYPE_BOOL);
     avio_put_byte(pb, !!b);
 }
 
 static int flv_write_header(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     FLVContext *flv = s->priv_data;
     AVCodecContext *audio_enc = NULL, *video_enc = NULL;
     int i;
@@ -330,7 +330,7 @@ static int flv_write_trailer(AVFormatContext *s)
 {
     int64_t file_size;
 
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     FLVContext *flv = s->priv_data;
     int i;
 
@@ -357,7 +357,7 @@ static int flv_write_trailer(AVFormatContext *s)
 
 static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVCodecContext *enc = s->streams[pkt->stream_index]->codec;
     FLVContext *flv = s->priv_data;
     unsigned ts;
diff --git a/libavformat/gif.c b/libavformat/gif.c
index e90eb32..0945f49 100644
--- a/libavformat/gif.c
+++ b/libavformat/gif.c
@@ -107,7 +107,7 @@ static const rgb_triplet gif_clut[216] = {
 };
 
 /* GIF header */
-static int gif_image_write_header(ByteIOContext *pb,
+static int gif_image_write_header(AVIOContext *pb,
                                   int width, int height, int loop_count,
                                   uint32_t *palette)
 {
@@ -179,7 +179,7 @@ static inline unsigned char gif_clut_index(uint8_t r, uint8_t g, uint8_t b)
 }
 
 
-static int gif_image_write_image(ByteIOContext *pb,
+static int gif_image_write_image(AVIOContext *pb,
                                  int x1, int y1, int width, int height,
                                  const uint8_t *buf, int linesize, int pix_fmt)
 {
@@ -252,7 +252,7 @@ typedef struct {
 static int gif_write_header(AVFormatContext *s)
 {
     GIFContext *gif = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVCodecContext *enc, *video_enc;
     int i, width, height, loop_count /*, rate*/;
 
@@ -294,7 +294,7 @@ static int gif_write_header(AVFormatContext *s)
 static int gif_write_video(AVFormatContext *s,
                            AVCodecContext *enc, const uint8_t *buf, int size)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     GIFContext *gif = s->priv_data;
     int jiffies;
     int64_t delay;
@@ -337,7 +337,7 @@ static int gif_write_packet(AVFormatContext *s, AVPacket *pkt)
 
 static int gif_write_trailer(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     avio_put_byte(pb, 0x3b);
     put_flush_packet(s->pb);
diff --git a/libavformat/gxf.c b/libavformat/gxf.c
index d5349e3..b89e30b 100644
--- a/libavformat/gxf.c
+++ b/libavformat/gxf.c
@@ -33,12 +33,12 @@ struct gxf_stream_info {
 
 /**
  * \brief parses a packet header, extracting type and length
- * \param pb ByteIOContext to read header from
+ * \param pb AVIOContext to read header from
  * \param type detected packet type is stored here
  * \param length detected packet length, excluding header is stored here
  * \return 0 if header not found or contains invalid data, 1 otherwise
  */
-static int parse_packet_header(ByteIOContext *pb, GXFPktType *type, int *length) {
+static int parse_packet_header(AVIOContext *pb, GXFPktType *type, int *length) {
     if (avio_get_be32(pb))
         return 0;
     if (avio_get_byte(pb) != 1)
@@ -157,7 +157,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) {
  * \param len length of tag section, will be adjusted to contain remaining bytes
  * \param si struct to store collected information into
  */
-static void gxf_material_tags(ByteIOContext *pb, int *len, struct gxf_stream_info *si) {
+static void gxf_material_tags(AVIOContext *pb, int *len, struct gxf_stream_info *si) {
     si->first_field = AV_NOPTS_VALUE;
     si->last_field = AV_NOPTS_VALUE;
     while (*len >= 2) {
@@ -206,7 +206,7 @@ static AVRational fps_umf2avr(uint32_t flags) {
  * \param len length of tag section, will be adjusted to contain remaining bytes
  * \param si struct to store collected information into
  */
-static void gxf_track_tags(ByteIOContext *pb, int *len, struct gxf_stream_info *si) {
+static void gxf_track_tags(AVIOContext *pb, int *len, struct gxf_stream_info *si) {
     si->frames_per_second = (AVRational){0, 0};
     si->fields_per_frame = 0;
     while (*len >= 2) {
@@ -231,7 +231,7 @@ static void gxf_track_tags(ByteIOContext *pb, int *len, struct gxf_stream_info *
  * \brief read index from FLT packet into stream 0 av_index
  */
 static void gxf_read_index(AVFormatContext *s, int pkt_len) {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st = s->streams[0];
     uint32_t fields_per_map = avio_get_le32(pb);
     uint32_t map_cnt = avio_get_le32(pb);
@@ -259,7 +259,7 @@ static void gxf_read_index(AVFormatContext *s, int pkt_len) {
 }
 
 static int gxf_header(AVFormatContext *s, AVFormatParameters *ap) {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     GXFPktType pkt_type;
     int map_len;
     int len;
@@ -387,7 +387,7 @@ static int64_t gxf_resync_media(AVFormatContext *s, uint64_t max_interval, int t
     int cur_track;
     int64_t cur_timestamp = AV_NOPTS_VALUE;
     int len;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     GXFPktType type;
     tmp = avio_get_be32(pb);
 start:
@@ -419,7 +419,7 @@ out:
 }
 
 static int gxf_packet(AVFormatContext *s, AVPacket *pkt) {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     GXFPktType pkt_type;
     int pkt_len;
     while (!url_feof(pb)) {
@@ -506,7 +506,7 @@ static int gxf_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int
 
 static int64_t gxf_read_timestamp(AVFormatContext *s, int stream_index,
                                   int64_t *pos, int64_t pos_limit) {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t res;
     if (url_fseek(pb, *pos, SEEK_SET) < 0)
         return AV_NOPTS_VALUE;
diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c
index 7f01b41..a97ad95 100644
--- a/libavformat/gxfenc.c
+++ b/libavformat/gxfenc.c
@@ -113,14 +113,14 @@ static int gxf_find_lines_index(AVStream *st)
     return -1;
 }
 
-static void gxf_write_padding(ByteIOContext *pb, int64_t to_pad)
+static void gxf_write_padding(AVIOContext *pb, int64_t to_pad)
 {
     for (; to_pad > 0; to_pad--) {
         avio_put_byte(pb, 0);
     }
 }
 
-static int64_t updatePacketSize(ByteIOContext *pb, int64_t pos)
+static int64_t updatePacketSize(AVIOContext *pb, int64_t pos)
 {
     int64_t curpos;
     int size;
@@ -137,7 +137,7 @@ static int64_t updatePacketSize(ByteIOContext *pb, int64_t pos)
     return curpos - pos;
 }
 
-static int64_t updateSize(ByteIOContext *pb, int64_t pos)
+static int64_t updateSize(AVIOContext *pb, int64_t pos)
 {
     int64_t curpos;
 
@@ -148,7 +148,7 @@ static int64_t updateSize(ByteIOContext *pb, int64_t pos)
     return curpos - pos;
 }
 
-static void gxf_write_packet_header(ByteIOContext *pb, GXFPktType type)
+static void gxf_write_packet_header(AVIOContext *pb, GXFPktType type)
 {
     avio_put_be32(pb, 0); /* packet leader for synchro */
     avio_put_byte(pb, 1);
@@ -159,7 +159,7 @@ static void gxf_write_packet_header(ByteIOContext *pb, GXFPktType type)
     avio_put_byte(pb, 0xE2); /* trailer 2 */
 }
 
-static int gxf_write_mpeg_auxiliary(ByteIOContext *pb, AVStream *st)
+static int gxf_write_mpeg_auxiliary(AVIOContext *pb, AVStream *st)
 {
     GXFStreamContext *sc = st->priv_data;
     char buffer[1024];
@@ -197,7 +197,7 @@ static int gxf_write_mpeg_auxiliary(ByteIOContext *pb, AVStream *st)
     return size + 3;
 }
 
-static int gxf_write_timecode_auxiliary(ByteIOContext *pb, GXFStreamContext *sc)
+static int gxf_write_timecode_auxiliary(AVIOContext *pb, GXFStreamContext *sc)
 {
     avio_put_byte(pb, 0); /* fields */
     avio_put_byte(pb, 0);  /* seconds */
@@ -210,7 +210,7 @@ static int gxf_write_timecode_auxiliary(ByteIOContext *pb, GXFStreamContext *sc)
 
 static int gxf_write_track_description(AVFormatContext *s, GXFStreamContext *sc, int index)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t pos;
     int mpeg = sc->track_type == 4 || sc->track_type == 9;
 
@@ -267,7 +267,7 @@ static int gxf_write_track_description(AVFormatContext *s, GXFStreamContext *sc,
 static int gxf_write_material_data_section(AVFormatContext *s)
 {
     GXFContext *gxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t pos;
     const char *filename = strrchr(s->filename, '/');
 
@@ -315,7 +315,7 @@ static int gxf_write_material_data_section(AVFormatContext *s)
 static int gxf_write_track_description_section(AVFormatContext *s)
 {
     GXFContext *gxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t pos;
     int i;
 
@@ -332,7 +332,7 @@ static int gxf_write_track_description_section(AVFormatContext *s)
 static int gxf_write_map_packet(AVFormatContext *s, int rewrite)
 {
     GXFContext *gxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t pos = url_ftell(pb);
 
     if (!rewrite) {
@@ -362,7 +362,7 @@ static int gxf_write_map_packet(AVFormatContext *s, int rewrite)
 static int gxf_write_flt_packet(AVFormatContext *s)
 {
     GXFContext *gxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t pos = url_ftell(pb);
     int fields_per_flt = (gxf->nb_fields+1) / 1000 + 1;
     int flt_entries = gxf->nb_fields / fields_per_flt;
@@ -387,7 +387,7 @@ static int gxf_write_flt_packet(AVFormatContext *s)
 static int gxf_write_umf_material_description(AVFormatContext *s)
 {
     GXFContext *gxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int timecode_base = gxf->time_base.den == 60000 ? 60 : 50;
 
     // XXX drop frame
@@ -418,7 +418,7 @@ static int gxf_write_umf_material_description(AVFormatContext *s)
 static int gxf_write_umf_payload(AVFormatContext *s)
 {
     GXFContext *gxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     avio_put_le32(pb, gxf->umf_length); /* total length of the umf data */
     avio_put_le32(pb, 3); /* version */
@@ -437,7 +437,7 @@ static int gxf_write_umf_payload(AVFormatContext *s)
 
 static int gxf_write_umf_track_description(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     GXFContext *gxf = s->priv_data;
     int64_t pos = url_ftell(pb);
     int i;
@@ -455,7 +455,7 @@ static int gxf_write_umf_track_description(AVFormatContext *s)
     return url_ftell(pb) - pos;
 }
 
-static int gxf_write_umf_media_mpeg(ByteIOContext *pb, AVStream *st)
+static int gxf_write_umf_media_mpeg(AVIOContext *pb, AVStream *st)
 {
     GXFStreamContext *sc = st->priv_data;
 
@@ -478,7 +478,7 @@ static int gxf_write_umf_media_mpeg(ByteIOContext *pb, AVStream *st)
     return 32;
 }
 
-static int gxf_write_umf_media_timecode(ByteIOContext *pb, GXFStreamContext *sc)
+static int gxf_write_umf_media_timecode(AVIOContext *pb, GXFStreamContext *sc)
 {
     avio_put_le32(pb, 1); /* non drop frame */
     avio_put_le32(pb, 0); /* reserved */
@@ -491,7 +491,7 @@ static int gxf_write_umf_media_timecode(ByteIOContext *pb, GXFStreamContext *sc)
     return 32;
 }
 
-static int gxf_write_umf_media_dv(ByteIOContext *pb, GXFStreamContext *sc)
+static int gxf_write_umf_media_dv(AVIOContext *pb, GXFStreamContext *sc)
 {
     int i;
 
@@ -501,7 +501,7 @@ static int gxf_write_umf_media_dv(ByteIOContext *pb, GXFStreamContext *sc)
     return 32;
 }
 
-static int gxf_write_umf_media_audio(ByteIOContext *pb, GXFStreamContext *sc)
+static int gxf_write_umf_media_audio(AVIOContext *pb, GXFStreamContext *sc)
 {
     avio_put_le64(pb, av_dbl2int(1)); /* sound level to begin to */
     avio_put_le64(pb, av_dbl2int(1)); /* sound level to begin to */
@@ -513,7 +513,7 @@ static int gxf_write_umf_media_audio(ByteIOContext *pb, GXFStreamContext *sc)
 }
 
 #if 0
-static int gxf_write_umf_media_mjpeg(ByteIOContext *pb, GXFStreamContext *sc)
+static int gxf_write_umf_media_mjpeg(AVIOContext *pb, GXFStreamContext *sc)
 {
     avio_put_be64(pb, 0); /* FIXME FLOAT max chroma quant level */
     avio_put_be64(pb, 0); /* FIXME FLOAT max luma quant level */
@@ -526,7 +526,7 @@ static int gxf_write_umf_media_mjpeg(ByteIOContext *pb, GXFStreamContext *sc)
 static int gxf_write_umf_media_description(AVFormatContext *s)
 {
     GXFContext *gxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t pos;
     int i, j;
 
@@ -588,7 +588,7 @@ static int gxf_write_umf_media_description(AVFormatContext *s)
 static int gxf_write_umf_packet(AVFormatContext *s)
 {
     GXFContext *gxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t pos = url_ftell(pb);
 
     gxf_write_packet_header(pb, PKT_UMF);
@@ -625,7 +625,7 @@ static void gxf_init_timecode_track(GXFStreamContext *sc, GXFStreamContext *vsc)
 
 static int gxf_write_header(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     GXFContext *gxf = s->priv_data;
     GXFStreamContext *vsc = NULL;
     uint8_t tracks[255] = {0};
@@ -754,7 +754,7 @@ static int gxf_write_header(AVFormatContext *s)
     return 0;
 }
 
-static int gxf_write_eos_packet(ByteIOContext *pb)
+static int gxf_write_eos_packet(AVIOContext *pb)
 {
     int64_t pos = url_ftell(pb);
 
@@ -765,7 +765,7 @@ static int gxf_write_eos_packet(ByteIOContext *pb)
 static int gxf_write_trailer(AVFormatContext *s)
 {
     GXFContext *gxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t end;
     int i;
 
@@ -809,7 +809,7 @@ static int gxf_parse_mpeg_frame(GXFStreamContext *sc, const uint8_t *buf, int si
 static int gxf_write_media_preamble(AVFormatContext *s, AVPacket *pkt, int size)
 {
     GXFContext *gxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st = s->streams[pkt->stream_index];
     GXFStreamContext *sc = st->priv_data;
     unsigned field_nb;
@@ -856,7 +856,7 @@ static int gxf_write_media_preamble(AVFormatContext *s, AVPacket *pkt, int size)
 static int gxf_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     GXFContext *gxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st = s->streams[pkt->stream_index];
     int64_t pos = url_ftell(pb);
     int padding = 0;
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 1c5a1bb..188f0af 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -50,7 +50,7 @@ int ff_id3v2_tag_len(const uint8_t * buf)
     return len;
 }
 
-static unsigned int get_size(ByteIOContext *s, int len)
+static unsigned int get_size(AVIOContext *s, int len)
 {
     int v = 0;
     while (len--)
@@ -58,13 +58,13 @@ static unsigned int get_size(ByteIOContext *s, int len)
     return v;
 }
 
-static void read_ttag(AVFormatContext *s, ByteIOContext *pb, int taglen, const char *key)
+static void read_ttag(AVFormatContext *s, AVIOContext *pb, int taglen, const char *key)
 {
     char *q, dst[512];
     const char *val = NULL;
     int len, dstlen = sizeof(dst) - 1;
     unsigned genre;
-    unsigned int (*get)(ByteIOContext*) = avio_get_be16;
+    unsigned int (*get)(AVIOContext*) = avio_get_be16;
 
     dst[0] = 0;
     if (taglen < 1)
@@ -142,7 +142,7 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t
     int64_t next;
     int taghdrlen;
     const char *reason;
-    ByteIOContext pb;
+    AVIOContext pb;
     unsigned char *buffer = NULL;
     int buffer_size = 0;
 
diff --git a/libavformat/idcin.c b/libavformat/idcin.c
index 5419c2c..9279f9f 100644
--- a/libavformat/idcin.c
+++ b/libavformat/idcin.c
@@ -142,7 +142,7 @@ static int idcin_probe(AVProbeData *p)
 static int idcin_read_header(AVFormatContext *s,
                              AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     IdcinDemuxContext *idcin = s->priv_data;
     AVStream *st;
     unsigned int width, height;
@@ -221,7 +221,7 @@ static int idcin_read_packet(AVFormatContext *s,
     unsigned int command;
     unsigned int chunk_size;
     IdcinDemuxContext *idcin = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int i;
     int palette_scale;
     unsigned char r, g, b;
diff --git a/libavformat/idroqdec.c b/libavformat/idroqdec.c
index 6ffacf5..e42f37d 100644
--- a/libavformat/idroqdec.c
+++ b/libavformat/idroqdec.c
@@ -68,7 +68,7 @@ static int roq_read_header(AVFormatContext *s,
                            AVFormatParameters *ap)
 {
     RoqDemuxContext *roq = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int framerate;
     AVStream *st;
     unsigned char preamble[RoQ_CHUNK_PREAMBLE_SIZE];
@@ -100,7 +100,7 @@ static int roq_read_packet(AVFormatContext *s,
                            AVPacket *pkt)
 {
     RoqDemuxContext *roq = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int ret = 0;
     unsigned int chunk_size;
     unsigned int chunk_type;
diff --git a/libavformat/iff.c b/libavformat/iff.c
index 0d8400f..c31486e 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -124,7 +124,7 @@ static int iff_read_header(AVFormatContext *s,
                            AVFormatParameters *ap)
 {
     IffDemuxContext *iff = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     uint32_t chunk_id, data_size;
     int compression = -1;
@@ -276,7 +276,7 @@ static int iff_read_packet(AVFormatContext *s,
                            AVPacket *pkt)
 {
     IffDemuxContext *iff = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st = s->streams[0];
     int ret;
 
diff --git a/libavformat/img2.c b/libavformat/img2.c
index 6e80072..a979abe 100644
--- a/libavformat/img2.c
+++ b/libavformat/img2.c
@@ -255,7 +255,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt)
     char filename[1024];
     int i;
     int size[3]={0}, ret[3]={0};
-    ByteIOContext *f[3];
+    AVIOContext *f[3];
     AVCodecContext *codec= s1->streams[0]->codec;
 
     if (!s->is_pipe) {
@@ -339,7 +339,7 @@ static int write_header(AVFormatContext *s)
 static int write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     VideoData *img = s->priv_data;
-    ByteIOContext *pb[3];
+    AVIOContext *pb[3];
     char filename[1024];
     AVCodecContext *codec= s->streams[ pkt->stream_index ]->codec;
     int i;
diff --git a/libavformat/internal.h b/libavformat/internal.h
index 16aa0af..02a27e4 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -157,20 +157,20 @@ int ff_get_v_length(uint64_t val);
 /**
  * Put val using a variable number of bytes.
  */
-void ff_put_v(ByteIOContext *bc, uint64_t val);
+void ff_put_v(AVIOContext *bc, uint64_t val);
 
 /**
- * Read a whole line of text from ByteIOContext. Stop reading after reaching
+ * Read a whole line of text from AVIOContext. Stop reading after reaching
  * either a \n, a \0 or EOF. The returned string is always \0 terminated,
  * and may be truncated if the buffer is too small.
  *
- * @param s the read-only ByteIOContext
+ * @param s the read-only AVIOContext
  * @param buf buffer to store the read line
  * @param maxlen size of the buffer
  * @return the length of the string written in the buffer, not including the
  *         final \0
  */
-int ff_get_line(ByteIOContext *s, char *buf, int maxlen);
+int ff_get_line(AVIOContext *s, char *buf, int maxlen);
 
 #define SPACE_CHARS " \t\r\n"
 
diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index 46b4d3a..925153b 100644
--- a/libavformat/ipmovie.c
+++ b/libavformat/ipmovie.c
@@ -120,7 +120,7 @@ typedef struct IPMVEContext {
 
 } IPMVEContext;
 
-static int load_ipmovie_packet(IPMVEContext *s, ByteIOContext *pb,
+static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
     AVPacket *pkt) {
 
     int chunk_type;
@@ -203,7 +203,7 @@ static int load_ipmovie_packet(IPMVEContext *s, ByteIOContext *pb,
 
 /* This function loads and processes a single chunk in an IP movie file.
  * It returns the type of chunk that was processed. */
-static int process_ipmovie_chunk(IPMVEContext *s, ByteIOContext *pb,
+static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
     AVPacket *pkt)
 {
     unsigned char chunk_preamble[CHUNK_PREAMBLE_SIZE];
@@ -521,7 +521,7 @@ static int ipmovie_read_header(AVFormatContext *s,
                                AVFormatParameters *ap)
 {
     IPMVEContext *ipmovie = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVPacket pkt;
     AVStream *st;
     unsigned char chunk_preamble[CHUNK_PREAMBLE_SIZE];
@@ -602,7 +602,7 @@ static int ipmovie_read_packet(AVFormatContext *s,
                                AVPacket *pkt)
 {
     IPMVEContext *ipmovie = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int ret;
 
     ret = process_ipmovie_chunk(ipmovie, pb, pkt);
diff --git a/libavformat/isom.c b/libavformat/isom.c
index 8b0a27e..88dfaaa 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -341,7 +341,7 @@ int ff_mov_lang_to_iso639(unsigned code, char to[4])
     return 1;
 }
 
-int ff_mp4_read_descr_len(ByteIOContext *pb)
+int ff_mp4_read_descr_len(AVIOContext *pb)
 {
     int len = 0;
     int count = 4;
@@ -354,7 +354,7 @@ int ff_mp4_read_descr_len(ByteIOContext *pb)
     return len;
 }
 
-int ff_mp4_read_descr(AVFormatContext *fc, ByteIOContext *pb, int *tag)
+int ff_mp4_read_descr(AVFormatContext *fc, AVIOContext *pb, int *tag)
 {
     int len;
     *tag = avio_get_byte(pb);
@@ -372,7 +372,7 @@ static const AVCodecTag mp4_audio_types[] = {
     { CODEC_ID_NONE,   AOT_NULL },
 };
 
-int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, ByteIOContext *pb)
+int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext *pb)
 {
     int len, tag;
     int object_type_id = avio_get_byte(pb);
diff --git a/libavformat/isom.h b/libavformat/isom.h
index 2990c9c..1df666f 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -88,7 +88,7 @@ typedef struct {
 } MOVTrackExt;
 
 typedef struct MOVStreamContext {
-    ByteIOContext *pb;
+    AVIOContext *pb;
     int ffindex;          ///< AVStream index
     int next_chunk;
     unsigned int chunk_count;
@@ -141,18 +141,18 @@ typedef struct MOVContext {
     int chapter_track;
 } MOVContext;
 
-int ff_mp4_read_descr_len(ByteIOContext *pb);
-int ff_mp4_read_descr(AVFormatContext *fc, ByteIOContext *pb, int *tag);
-int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, ByteIOContext *pb);
+int ff_mp4_read_descr_len(AVIOContext *pb);
+int ff_mp4_read_descr(AVFormatContext *fc, AVIOContext *pb, int *tag);
+int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext *pb);
 
 #define MP4IODescrTag                   0x02
 #define MP4ESDescrTag                   0x03
 #define MP4DecConfigDescrTag            0x04
 #define MP4DecSpecificDescrTag          0x05
 
-int ff_mov_read_esds(AVFormatContext *fc, ByteIOContext *pb, MOVAtom atom);
+int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb, MOVAtom atom);
 enum CodecID ff_mov_get_lpcm_codec_id(int bps, int flags);
 
-int ff_mov_read_stsd_entries(MOVContext *c, ByteIOContext *pb, int entries);
+int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries);
 
 #endif /* AVFORMAT_ISOM_H */
diff --git a/libavformat/iss.c b/libavformat/iss.c
index 4ebba85..daf8bba 100644
--- a/libavformat/iss.c
+++ b/libavformat/iss.c
@@ -39,7 +39,7 @@ typedef struct {
     int sample_start_pos;
 } IssDemuxContext;
 
-static void get_token(ByteIOContext *s, char *buf, int maxlen)
+static void get_token(AVIOContext *s, char *buf, int maxlen)
 {
     int i = 0;
     char c;
@@ -68,7 +68,7 @@ static int iss_probe(AVProbeData *p)
 static av_cold int iss_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     IssDemuxContext *iss = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     char token[MAX_TOKEN_SIZE];
     int stereo, rate_divisor;
diff --git a/libavformat/ivfenc.c b/libavformat/ivfenc.c
index cb6fb11..863dfd5 100644
--- a/libavformat/ivfenc.c
+++ b/libavformat/ivfenc.c
@@ -23,7 +23,7 @@
 static int ivf_write_header(AVFormatContext *s)
 {
     AVCodecContext *ctx;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     if (s->nb_streams != 1) {
         av_log(s, AV_LOG_ERROR, "Format supports only exactly one video stream\n");
@@ -49,7 +49,7 @@ static int ivf_write_header(AVFormatContext *s)
 
 static int ivf_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     avio_put_le32(pb, pkt->size);
     avio_put_le64(pb, pkt->pts);
     avio_put_buffer(pb, pkt->data, pkt->size);
diff --git a/libavformat/libnut.c b/libavformat/libnut.c
index 6c57be3..8a7774a 100644
--- a/libavformat/libnut.c
+++ b/libavformat/libnut.c
@@ -46,7 +46,7 @@ static const AVCodecTag nut_tags[] = {
 
 #if CONFIG_LIBNUT_MUXER
 static int av_write(void * h, size_t len, const uint8_t * buf) {
-    ByteIOContext * bc = h;
+    AVIOContext * bc = h;
     avio_put_buffer(bc, buf, len);
     //put_flush_packet(bc);
     return len;
@@ -54,7 +54,7 @@ static int av_write(void * h, size_t len, const uint8_t * buf) {
 
 static int nut_write_header(AVFormatContext * avf) {
     NUTContext * priv = avf->priv_data;
-    ByteIOContext * bc = avf->pb;
+    AVIOContext * bc = avf->pb;
     nut_muxer_opts_tt mopts = {
         .output = {
             .priv = bc,
@@ -137,7 +137,7 @@ static int nut_write_packet(AVFormatContext * avf, AVPacket * pkt) {
 }
 
 static int nut_write_trailer(AVFormatContext * avf) {
-    ByteIOContext * bc = avf->pb;
+    AVIOContext * bc = avf->pb;
     NUTContext * priv = avf->priv_data;
     int i;
 
@@ -172,12 +172,12 @@ static int nut_probe(AVProbeData *p) {
 }
 
 static size_t av_read(void * h, size_t len, uint8_t * buf) {
-    ByteIOContext * bc = h;
+    AVIOContext * bc = h;
     return avio_get_buffer(bc, buf, len);
 }
 
 static off_t av_seek(void * h, long long pos, int whence) {
-    ByteIOContext * bc = h;
+    AVIOContext * bc = h;
     if (whence == SEEK_END) {
         pos = url_fsize(bc) + pos;
         whence = SEEK_SET;
@@ -187,7 +187,7 @@ static off_t av_seek(void * h, long long pos, int whence) {
 
 static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) {
     NUTContext * priv = avf->priv_data;
-    ByteIOContext * bc = avf->pb;
+    AVIOContext * bc = avf->pb;
     nut_demuxer_opts_tt dopts = {
         .input = {
             .priv = bc,
diff --git a/libavformat/lmlm4.c b/libavformat/lmlm4.c
index 1caa6c1..093ad09 100644
--- a/libavformat/lmlm4.c
+++ b/libavformat/lmlm4.c
@@ -78,7 +78,7 @@ static int lmlm4_read_header(AVFormatContext *s, AVFormatParameters *ap) {
 }
 
 static int lmlm4_read_packet(AVFormatContext *s, AVPacket *pkt) {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int ret;
     unsigned int frame_type, packet_size, padding, frame_size;
 
diff --git a/libavformat/lxfdec.c b/libavformat/lxfdec.c
index 39a36c4..549f649 100644
--- a/libavformat/lxfdec.c
+++ b/libavformat/lxfdec.c
@@ -111,7 +111,7 @@ static int sync(AVFormatContext *s, uint8_t *header)
  */
 static int get_packet_header(AVFormatContext *s, uint8_t *header, uint32_t *format)
 {
-    ByteIOContext   *pb  = s->pb;
+    AVIOContext   *pb  = s->pb;
     int track_size, samples, ret;
     AVStream *st;
 
@@ -198,7 +198,7 @@ static int get_packet_header(AVFormatContext *s, uint8_t *header, uint32_t *form
 static int lxf_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     LXFDemuxContext *lxf = s->priv_data;
-    ByteIOContext   *pb  = s->pb;
+    AVIOContext   *pb  = s->pb;
     uint8_t header[LXF_PACKET_HEADER_SIZE], header_data[LXF_HEADER_DATA_SIZE];
     int ret;
     AVStream *st;
@@ -281,7 +281,7 @@ static void deplanarize(LXFDemuxContext *lxf, AVStream *ast, uint8_t *out, int b
 static int lxf_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     LXFDemuxContext *lxf = s->priv_data;
-    ByteIOContext   *pb  = s->pb;
+    AVIOContext   *pb  = s->pb;
     uint8_t header[LXF_PACKET_HEADER_SIZE], *buf;
     AVStream *ast = NULL;
     uint32_t stream, format;
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 5a9a13c..ee1bad4 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -515,7 +515,7 @@ static const char *matroska_doctypes[] = { "matroska", "webm" };
  */
 static int ebml_level_end(MatroskaDemuxContext *matroska)
 {
-    ByteIOContext *pb = matroska->ctx->pb;
+    AVIOContext *pb = matroska->ctx->pb;
     int64_t pos = url_ftell(pb);
 
     if (matroska->num_levels > 0) {
@@ -536,7 +536,7 @@ static int ebml_level_end(MatroskaDemuxContext *matroska)
  * number.
  * Returns: number of bytes read, < 0 on error
  */
-static int ebml_read_num(MatroskaDemuxContext *matroska, ByteIOContext *pb,
+static int ebml_read_num(MatroskaDemuxContext *matroska, AVIOContext *pb,
                          int max_size, uint64_t *number)
 {
     int read = 1, n = 1;
@@ -581,7 +581,7 @@ static int ebml_read_num(MatroskaDemuxContext *matroska, ByteIOContext *pb,
  * This needs special handling for the "unknown length" case which has multiple
  * encodings.
  */
-static int ebml_read_length(MatroskaDemuxContext *matroska, ByteIOContext *pb,
+static int ebml_read_length(MatroskaDemuxContext *matroska, AVIOContext *pb,
                             uint64_t *number)
 {
     int res = ebml_read_num(matroska, pb, 8, number);
@@ -594,7 +594,7 @@ static int ebml_read_length(MatroskaDemuxContext *matroska, ByteIOContext *pb,
  * Read the next element as an unsigned int.
  * 0 is success, < 0 is failure.
  */
-static int ebml_read_uint(ByteIOContext *pb, int size, uint64_t *num)
+static int ebml_read_uint(AVIOContext *pb, int size, uint64_t *num)
 {
     int n = 0;
 
@@ -613,7 +613,7 @@ static int ebml_read_uint(ByteIOContext *pb, int size, uint64_t *num)
  * Read the next element as a float.
  * 0 is success, < 0 is failure.
  */
-static int ebml_read_float(ByteIOContext *pb, int size, double *num)
+static int ebml_read_float(AVIOContext *pb, int size, double *num)
 {
     if (size == 0) {
         *num = 0;
@@ -631,7 +631,7 @@ static int ebml_read_float(ByteIOContext *pb, int size, double *num)
  * Read the next element as an ASCII string.
  * 0 is success, < 0 is failure.
  */
-static int ebml_read_ascii(ByteIOContext *pb, int size, char **str)
+static int ebml_read_ascii(AVIOContext *pb, int size, char **str)
 {
     av_free(*str);
     /* EBML strings are usually not 0-terminated, so we allocate one
@@ -651,7 +651,7 @@ static int ebml_read_ascii(ByteIOContext *pb, int size, char **str)
  * Read the next element as binary data.
  * 0 is success, < 0 is failure.
  */
-static int ebml_read_binary(ByteIOContext *pb, int length, EbmlBin *bin)
+static int ebml_read_binary(AVIOContext *pb, int length, EbmlBin *bin)
 {
     av_free(bin->data);
     if (!(bin->data = av_malloc(length)))
@@ -674,7 +674,7 @@ static int ebml_read_binary(ByteIOContext *pb, int length, EbmlBin *bin)
  */
 static int ebml_read_master(MatroskaDemuxContext *matroska, uint64_t length)
 {
-    ByteIOContext *pb = matroska->ctx->pb;
+    AVIOContext *pb = matroska->ctx->pb;
     MatroskaLevel *level;
 
     if (matroska->num_levels >= EBML_MAX_DEPTH) {
@@ -697,7 +697,7 @@ static int ebml_read_master(MatroskaDemuxContext *matroska, uint64_t length)
 static int matroska_ebmlnum_uint(MatroskaDemuxContext *matroska,
                                  uint8_t *data, uint32_t size, uint64_t *num)
 {
-    ByteIOContext pb;
+    AVIOContext pb;
     init_put_byte(&pb, data, size, 0, NULL, NULL, NULL, NULL);
     return ebml_read_num(matroska, &pb, FFMIN(size, 8), num);
 }
@@ -791,7 +791,7 @@ static int ebml_parse_elem(MatroskaDemuxContext *matroska,
         [EBML_BIN]   = 0x10000000,
         // no limits for anything else
     };
-    ByteIOContext *pb = matroska->ctx->pb;
+    AVIOContext *pb = matroska->ctx->pb;
     uint32_t id = syntax->id;
     uint64_t length;
     int res;
@@ -1242,7 +1242,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
         uint8_t *extradata = NULL;
         int extradata_size = 0;
         int extradata_offset = 0;
-        ByteIOContext b;
+        AVIOContext b;
 
         /* Apply some sanity checks. */
         if (track->type != MATROSKA_TRACK_TYPE_VIDEO &&
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 3600576..6ee8a68 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -74,7 +74,7 @@ typedef struct {
 
 typedef struct MatroskaMuxContext {
     int             mode;
-    ByteIOContext   *dyn_bc;
+    AVIOContext   *dyn_bc;
     ebml_master     segment;
     int64_t         segment_offset;
     ebml_master     cluster;
@@ -108,7 +108,7 @@ static int ebml_id_size(unsigned int id)
     return (av_log2(id+1)-1)/7+1;
 }
 
-static void put_ebml_id(ByteIOContext *pb, unsigned int id)
+static void put_ebml_id(AVIOContext *pb, unsigned int id)
 {
     int i = ebml_id_size(id);
     while (i--)
@@ -120,7 +120,7 @@ static void put_ebml_id(ByteIOContext *pb, unsigned int id)
  *
  * @param bytes The number of bytes the size should occupy (maximum: 8).
  */
-static void put_ebml_size_unknown(ByteIOContext *pb, int bytes)
+static void put_ebml_size_unknown(AVIOContext *pb, int bytes)
 {
     assert(bytes <= 8);
     avio_put_byte(pb, 0x1ff >> bytes);
@@ -144,7 +144,7 @@ static int ebml_num_size(uint64_t num)
  * @param bytes The number of bytes that need to be used to write the number.
  *              If zero, any number of bytes can be used.
  */
-static void put_ebml_num(ByteIOContext *pb, uint64_t num, int bytes)
+static void put_ebml_num(AVIOContext *pb, uint64_t num, int bytes)
 {
     int i, needed_bytes = ebml_num_size(num);
 
@@ -163,7 +163,7 @@ static void put_ebml_num(ByteIOContext *pb, uint64_t num, int bytes)
         avio_put_byte(pb, num >> i*8);
 }
 
-static void put_ebml_uint(ByteIOContext *pb, unsigned int elementid, uint64_t val)
+static void put_ebml_uint(AVIOContext *pb, unsigned int elementid, uint64_t val)
 {
     int i, bytes = 1;
     uint64_t tmp = val;
@@ -175,14 +175,14 @@ static void put_ebml_uint(ByteIOContext *pb, unsigned int elementid, uint64_t va
         avio_put_byte(pb, val >> i*8);
 }
 
-static void put_ebml_float(ByteIOContext *pb, unsigned int elementid, double val)
+static void put_ebml_float(AVIOContext *pb, unsigned int elementid, double val)
 {
     put_ebml_id(pb, elementid);
     put_ebml_num(pb, 8, 0);
     avio_put_be64(pb, av_dbl2int(val));
 }
 
-static void put_ebml_binary(ByteIOContext *pb, unsigned int elementid,
+static void put_ebml_binary(AVIOContext *pb, unsigned int elementid,
                             const void *buf, int size)
 {
     put_ebml_id(pb, elementid);
@@ -190,7 +190,7 @@ static void put_ebml_binary(ByteIOContext *pb, unsigned int elementid,
     avio_put_buffer(pb, buf, size);
 }
 
-static void put_ebml_string(ByteIOContext *pb, unsigned int elementid, const char *str)
+static void put_ebml_string(AVIOContext *pb, unsigned int elementid, const char *str)
 {
     put_ebml_binary(pb, elementid, str, strlen(str));
 }
@@ -201,7 +201,7 @@ static void put_ebml_string(ByteIOContext *pb, unsigned int elementid, const cha
  *
  * @param size The number of bytes to reserve, which must be at least 2.
  */
-static void put_ebml_void(ByteIOContext *pb, uint64_t size)
+static void put_ebml_void(AVIOContext *pb, uint64_t size)
 {
     int64_t currentpos = url_ftell(pb);
 
@@ -219,7 +219,7 @@ static void put_ebml_void(ByteIOContext *pb, uint64_t size)
         avio_put_byte(pb, 0);
 }
 
-static ebml_master start_ebml_master(ByteIOContext *pb, unsigned int elementid, uint64_t expectedsize)
+static ebml_master start_ebml_master(AVIOContext *pb, unsigned int elementid, uint64_t expectedsize)
 {
     int bytes = expectedsize ? ebml_num_size(expectedsize) : 8;
     put_ebml_id(pb, elementid);
@@ -227,7 +227,7 @@ static ebml_master start_ebml_master(ByteIOContext *pb, unsigned int elementid,
     return (ebml_master){ url_ftell(pb), bytes };
 }
 
-static void end_ebml_master(ByteIOContext *pb, ebml_master master)
+static void end_ebml_master(AVIOContext *pb, ebml_master master)
 {
     int64_t pos = url_ftell(pb);
 
@@ -237,7 +237,7 @@ static void end_ebml_master(ByteIOContext *pb, ebml_master master)
     url_fseek(pb, pos, SEEK_SET);
 }
 
-static void put_xiph_size(ByteIOContext *pb, int size)
+static void put_xiph_size(AVIOContext *pb, int size)
 {
     int i;
     for (i = 0; i < size / 255; i++)
@@ -256,7 +256,7 @@ static void put_xiph_size(ByteIOContext *pb, int size)
  * @param numelements The maximum number of elements that will be indexed
  *                    by this seek head, 0 if unlimited.
  */
-static mkv_seekhead * mkv_start_seekhead(ByteIOContext *pb, int64_t segment_offset, int numelements)
+static mkv_seekhead * mkv_start_seekhead(AVIOContext *pb, int64_t segment_offset, int numelements)
 {
     mkv_seekhead *new_seekhead = av_mallocz(sizeof(mkv_seekhead));
     if (new_seekhead == NULL)
@@ -304,7 +304,7 @@ static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, unsigned int elementid
  * @return The file offset where the seekhead was written,
  * -1 if an error occurred.
  */
-static int64_t mkv_write_seekhead(ByteIOContext *pb, mkv_seekhead *seekhead)
+static int64_t mkv_write_seekhead(AVIOContext *pb, mkv_seekhead *seekhead)
 {
     ebml_master metaseek, seekentry;
     int64_t currentpos;
@@ -373,7 +373,7 @@ static int mkv_add_cuepoint(mkv_cues *cues, int stream, int64_t ts, int64_t clus
     return 0;
 }
 
-static int64_t mkv_write_cues(ByteIOContext *pb, mkv_cues *cues, int num_tracks)
+static int64_t mkv_write_cues(AVIOContext *pb, mkv_cues *cues, int num_tracks)
 {
     ebml_master cues_element;
     int64_t currentpos;
@@ -408,7 +408,7 @@ static int64_t mkv_write_cues(ByteIOContext *pb, mkv_cues *cues, int num_tracks)
     return currentpos;
 }
 
-static int put_xiph_codecpriv(AVFormatContext *s, ByteIOContext *pb, AVCodecContext *codec)
+static int put_xiph_codecpriv(AVFormatContext *s, AVIOContext *pb, AVCodecContext *codec)
 {
     uint8_t *header_start[3];
     int header_len[3];
@@ -463,9 +463,9 @@ static void get_aac_sample_rates(AVFormatContext *s, AVCodecContext *codec, int
     }
 }
 
-static int mkv_write_codecprivate(AVFormatContext *s, ByteIOContext *pb, AVCodecContext *codec, int native_id, int qt_id)
+static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecContext *codec, int native_id, int qt_id)
 {
-    ByteIOContext *dyn_cp;
+    AVIOContext *dyn_cp;
     uint8_t *codecpriv;
     int ret, codecpriv_size;
 
@@ -522,7 +522,7 @@ static int mkv_write_codecprivate(AVFormatContext *s, ByteIOContext *pb, AVCodec
 static int mkv_write_tracks(AVFormatContext *s)
 {
     MatroskaMuxContext *mkv = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     ebml_master tracks;
     int i, j, ret;
 
@@ -650,7 +650,7 @@ static int mkv_write_tracks(AVFormatContext *s)
 static int mkv_write_chapters(AVFormatContext *s)
 {
     MatroskaMuxContext *mkv = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     ebml_master chapters, editionentry;
     AVRational scale = {1, 1E9};
     int i, ret;
@@ -691,7 +691,7 @@ static int mkv_write_chapters(AVFormatContext *s)
     return 0;
 }
 
-static void mkv_write_simpletag(ByteIOContext *pb, AVMetadataTag *t)
+static void mkv_write_simpletag(AVIOContext *pb, AVMetadataTag *t)
 {
     uint8_t *key = av_strdup(t->key);
     uint8_t *p   = key;
@@ -790,7 +790,7 @@ static int mkv_write_tags(AVFormatContext *s)
 static int mkv_write_header(AVFormatContext *s)
 {
     MatroskaMuxContext *mkv = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     ebml_master ebml_header, segment_info;
     AVMetadataTag *tag;
     int ret, i;
@@ -901,7 +901,7 @@ static int ass_get_duration(const uint8_t *p)
     return end - start;
 }
 
-static int mkv_write_ass_blocks(AVFormatContext *s, ByteIOContext *pb, AVPacket *pkt)
+static int mkv_write_ass_blocks(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
 {
     MatroskaMuxContext *mkv = s->priv_data;
     int i, layer = 0, max_duration = 0, size, line_size, data_size = pkt->size;
@@ -946,7 +946,7 @@ static int mkv_write_ass_blocks(AVFormatContext *s, ByteIOContext *pb, AVPacket
     return max_duration;
 }
 
-static void mkv_write_block(AVFormatContext *s, ByteIOContext *pb,
+static void mkv_write_block(AVFormatContext *s, AVIOContext *pb,
                             unsigned int blockid, AVPacket *pkt, int flags)
 {
     MatroskaMuxContext *mkv = s->priv_data;
@@ -992,7 +992,7 @@ static int srt_get_duration(uint8_t **buf)
     return duration;
 }
 
-static int mkv_write_srt_blocks(AVFormatContext *s, ByteIOContext *pb, AVPacket *pkt)
+static int mkv_write_srt_blocks(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
 {
     ebml_master blockgroup;
     AVPacket pkt2 = *pkt;
@@ -1026,7 +1026,7 @@ static void mkv_flush_dynbuf(AVFormatContext *s)
 static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
 {
     MatroskaMuxContext *mkv = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVCodecContext *codec = s->streams[pkt->stream_index]->codec;
     int keyframe = !!(pkt->flags & AV_PKT_FLAG_KEY);
     int duration = pkt->duration;
@@ -1090,7 +1090,7 @@ static int mkv_copy_packet(MatroskaMuxContext *mkv, const AVPacket *pkt)
 static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     MatroskaMuxContext *mkv = s->priv_data;
-    ByteIOContext *pb = url_is_streamed(s->pb) ? mkv->dyn_bc : s->pb;
+    AVIOContext *pb = url_is_streamed(s->pb) ? mkv->dyn_bc : s->pb;
     AVCodecContext *codec = s->streams[pkt->stream_index]->codec;
     int ret, keyframe = !!(pkt->flags & AV_PKT_FLAG_KEY);
     int64_t ts = mkv->tracks[pkt->stream_index].write_dts ? pkt->dts : pkt->pts;
@@ -1132,7 +1132,7 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt)
 static int mkv_write_trailer(AVFormatContext *s)
 {
     MatroskaMuxContext *mkv = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t currentpos, cuespos;
     int ret;
 
diff --git a/libavformat/mm.c b/libavformat/mm.c
index 5c99fcd..1e32f41 100644
--- a/libavformat/mm.c
+++ b/libavformat/mm.c
@@ -84,7 +84,7 @@ static int read_header(AVFormatContext *s,
                            AVFormatParameters *ap)
 {
     MmDemuxContext *mm = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
 
     unsigned int type, length;
@@ -137,7 +137,7 @@ static int read_packet(AVFormatContext *s,
                            AVPacket *pkt)
 {
     MmDemuxContext *mm = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned char preamble[MM_PREAMBLE_SIZE];
     unsigned int type, length;
 
diff --git a/libavformat/mmf.c b/libavformat/mmf.c
index 7b4cb7c..b58b15a 100644
--- a/libavformat/mmf.c
+++ b/libavformat/mmf.c
@@ -47,7 +47,7 @@ static int mmf_rate_code(int rate)
 }
 
 /* Copy of end_tag() from avienc.c, but for big-endian chunk size */
-static void end_tag_be(ByteIOContext *pb, int64_t start)
+static void end_tag_be(AVIOContext *pb, int64_t start)
 {
     int64_t pos;
 
@@ -60,7 +60,7 @@ static void end_tag_be(ByteIOContext *pb, int64_t start)
 static int mmf_write_header(AVFormatContext *s)
 {
     MMFContext *mmf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t pos;
     int rate;
 
@@ -108,13 +108,13 @@ static int mmf_write_header(AVFormatContext *s)
 
 static int mmf_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     avio_put_buffer(pb, pkt->data, pkt->size);
     return 0;
 }
 
 /* Write a variable-length symbol */
-static void put_varlength(ByteIOContext *pb, int val)
+static void put_varlength(AVIOContext *pb, int val)
 {
     if(val < 128)
         avio_put_byte(pb, val);
@@ -127,7 +127,7 @@ static void put_varlength(ByteIOContext *pb, int val)
 
 static int mmf_write_trailer(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     MMFContext *mmf = s->priv_data;
     int64_t pos, size;
     int gatetime;
@@ -183,7 +183,7 @@ static int mmf_read_header(AVFormatContext *s,
 {
     MMFContext *mmf = s->priv_data;
     unsigned int tag;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     int64_t file_size, size;
     int rate, params;
diff --git a/libavformat/mmst.c b/libavformat/mmst.c
index a2b55b5..8d7ed05 100644
--- a/libavformat/mmst.c
+++ b/libavformat/mmst.c
@@ -152,7 +152,7 @@ static int send_command_packet(MMSTContext *mmst)
 
 static void mms_put_utf16(MMSContext *mms, uint8_t *src)
 {
-    ByteIOContext bic;
+    AVIOContext bic;
     int size = mms->write_out_ptr - mms->out_buffer;
     int len;
     init_put_byte(&bic, mms->write_out_ptr,
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6d0ee8e..70968c1 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -73,12 +73,12 @@
 /* links atom IDs to parse functions */
 typedef struct MOVParseTableEntry {
     uint32_t type;
-    int (*parse)(MOVContext *ctx, ByteIOContext *pb, MOVAtom atom);
+    int (*parse)(MOVContext *ctx, AVIOContext *pb, MOVAtom atom);
 } MOVParseTableEntry;
 
 static const MOVParseTableEntry mov_default_parse_table[];
 
-static int mov_metadata_trkn(MOVContext *c, ByteIOContext *pb, unsigned len)
+static int mov_metadata_trkn(MOVContext *c, AVIOContext *pb, unsigned len)
 {
     char buf[16];
 
@@ -110,7 +110,7 @@ static const uint32_t mac_to_unicode[128] = {
     0x00AF,0x02D8,0x02D9,0x02DA,0x00B8,0x02DD,0x02DB,0x02C7,
 };
 
-static int mov_read_mac_string(MOVContext *c, ByteIOContext *pb, int len,
+static int mov_read_mac_string(MOVContext *c, AVIOContext *pb, int len,
                                char *dst, int dstlen)
 {
     char *p = dst;
@@ -128,7 +128,7 @@ static int mov_read_mac_string(MOVContext *c, ByteIOContext *pb, int len,
     return p - dst;
 }
 
-static int mov_read_udta_string(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
 #ifdef MOV_EXPORT_ALL_METADATA
     char tmp_key[5];
@@ -137,7 +137,7 @@ static int mov_read_udta_string(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     const char *key = NULL;
     uint16_t str_size, langcode = 0;
     uint32_t data_type = 0;
-    int (*parse)(MOVContext*, ByteIOContext*, unsigned) = NULL;
+    int (*parse)(MOVContext*, AVIOContext*, unsigned) = NULL;
 
     switch (atom.type) {
     case MKTAG(0xa9,'n','a','m'): key = "title";     break;
@@ -218,7 +218,7 @@ static int mov_read_udta_string(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_chpl(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_chpl(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     int64_t start;
     int i, nb_chapters, str_len, version;
@@ -250,7 +250,7 @@ static int mov_read_chpl(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_default(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     int64_t total_size = 0;
     MOVAtom a;
@@ -259,7 +259,7 @@ static int mov_read_default(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     if (atom.size < 0)
         atom.size = INT64_MAX;
     while (total_size + 8 < atom.size && !url_feof(pb)) {
-        int (*parse)(MOVContext*, ByteIOContext*, MOVAtom) = NULL;
+        int (*parse)(MOVContext*, AVIOContext*, MOVAtom) = NULL;
         a.size = atom.size;
         a.type=0;
         if(atom.size >= 8) {
@@ -319,7 +319,7 @@ static int mov_read_default(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
     MOVStreamContext *sc;
@@ -423,7 +423,7 @@ static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_hdlr(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
     uint32_t type;
@@ -460,7 +460,7 @@ static int mov_read_hdlr(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-int ff_mov_read_esds(AVFormatContext *fc, ByteIOContext *pb, MOVAtom atom)
+int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
     int tag, len;
@@ -483,12 +483,12 @@ int ff_mov_read_esds(AVFormatContext *fc, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_esds(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     return ff_mov_read_esds(c->fc, pb, atom);
 }
 
-static int mov_read_dac3(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
     int ac3info, acmod, lfeon;
@@ -505,7 +505,7 @@ static int mov_read_dac3(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_pasp(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_pasp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     const int num = avio_get_be32(pb);
     const int den = avio_get_be32(pb);
@@ -529,7 +529,7 @@ static int mov_read_pasp(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 }
 
 /* this atom contains actual media data */
-static int mov_read_mdat(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_mdat(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     if(atom.size == 0) /* wrong one (MP4) */
         return 0;
@@ -538,7 +538,7 @@ static int mov_read_mdat(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 }
 
 /* read major brand, minor version and compatible brands and store them as metadata */
-static int mov_read_ftyp(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     uint32_t minor_ver;
     int comp_brand_size;
@@ -570,7 +570,7 @@ static int mov_read_ftyp(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 }
 
 /* this atom should contain all header atoms */
-static int mov_read_moov(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_moov(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     if (mov_read_default(c, pb, atom) < 0)
         return -1;
@@ -580,7 +580,7 @@ static int mov_read_moov(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0; /* now go for mdat */
 }
 
-static int mov_read_moof(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_moof(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     c->fragment.moof_offset = url_ftell(pb) - 8;
     av_dlog(c->fc, "moof offset %llx\n", c->fragment.moof_offset);
@@ -600,7 +600,7 @@ static void mov_metadata_creation_time(AVMetadata **metadata, time_t time)
     }
 }
 
-static int mov_read_mdhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_mdhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
     MOVStreamContext *sc;
@@ -639,7 +639,7 @@ static int mov_read_mdhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_mvhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     time_t creation_time;
     int version = avio_get_byte(pb); /* version */
@@ -677,7 +677,7 @@ static int mov_read_mvhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_smi(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_smi(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
 
@@ -701,7 +701,7 @@ static int mov_read_smi(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_enda(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_enda(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
     int little_endian;
@@ -734,7 +734,7 @@ static int mov_read_enda(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 }
 
 /* FIXME modify qdm2/svq3/h264 decoders to take full atom as extradata */
-static int mov_read_extradata(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_extradata(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
     uint64_t size;
@@ -758,7 +758,7 @@ static int mov_read_extradata(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_wave(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_wave(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
 
@@ -789,7 +789,7 @@ static int mov_read_wave(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  * This function reads atom content and puts data in extradata without tag
  * nor size unlike mov_read_extradata.
  */
-static int mov_read_glbl(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_glbl(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
 
@@ -814,7 +814,7 @@ static int mov_read_glbl(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  * but can have extradata appended at the end after the 40 bytes belonging
  * to the struct.
  */
-static int mov_read_strf(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_strf(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
 
@@ -837,7 +837,7 @@ static int mov_read_strf(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_stco(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
     MOVStreamContext *sc;
@@ -908,7 +908,7 @@ enum CodecID ff_mov_get_lpcm_codec_id(int bps, int flags)
     return CODEC_ID_NONE;
 }
 
-int ff_mov_read_stsd_entries(MOVContext *c, ByteIOContext *pb, int entries)
+int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
 {
     AVStream *st;
     MOVStreamContext *sc;
@@ -1244,7 +1244,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, ByteIOContext *pb, int entries)
     return 0;
 }
 
-static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     int entries;
 
@@ -1255,7 +1255,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return ff_mov_read_stsd_entries(c, pb, entries);
 }
 
-static int mov_read_stsc(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
     MOVStreamContext *sc;
@@ -1288,7 +1288,7 @@ static int mov_read_stsc(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_stps(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_stps(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
     MOVStreamContext *sc;
@@ -1317,7 +1317,7 @@ static int mov_read_stps(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
     MOVStreamContext *sc;
@@ -1349,7 +1349,7 @@ static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
     MOVStreamContext *sc;
@@ -1417,7 +1417,7 @@ static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
     MOVStreamContext *sc;
@@ -1464,7 +1464,7 @@ static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
     MOVStreamContext *sc;
@@ -1682,7 +1682,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
     }
 }
 
-static int mov_open_dref(ByteIOContext **pb, char *src, MOVDref *ref)
+static int mov_open_dref(AVIOContext **pb, char *src, MOVDref *ref)
 {
     /* try relative path, we do not try the absolute because it can leak information about our
        system to an attacker */
@@ -1725,7 +1725,7 @@ static int mov_open_dref(ByteIOContext **pb, char *src, MOVDref *ref)
     return AVERROR(ENOENT);
 }
 
-static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
     MOVStreamContext *sc;
@@ -1824,7 +1824,7 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_ilst(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_ilst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     int ret;
     c->itunes_metadata = 1;
@@ -1833,7 +1833,7 @@ static int mov_read_ilst(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return ret;
 }
 
-static int mov_read_meta(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_meta(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     while (atom.size > 8) {
         uint32_t tag = avio_get_le32(pb);
@@ -1847,7 +1847,7 @@ static int mov_read_meta(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_tkhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     int i;
     int width;
@@ -1930,7 +1930,7 @@ static int mov_read_tkhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_tfhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     MOVFragment *frag = &c->fragment;
     MOVTrackExt *trex = NULL;
@@ -1965,13 +1965,13 @@ static int mov_read_tfhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_chap(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_chap(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     c->chapter_track = avio_get_be32(pb);
     return 0;
 }
 
-static int mov_read_trex(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_trex(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     MOVTrackExt *trex;
 
@@ -1992,7 +1992,7 @@ static int mov_read_trex(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_trun(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     MOVFragment *frag = &c->fragment;
     AVStream *st = NULL;
@@ -2070,7 +2070,7 @@ static int mov_read_trun(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 /* this atom should be null (from specs), but some buggy files put the 'moov' atom inside it... */
 /* like the files created with Adobe Premiere 5.0, for samples see */
 /* http://graphics.tudelft.nl/~wouter/publications/soundtests/ */
-static int mov_read_wide(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_wide(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     int err;
 
@@ -2090,10 +2090,10 @@ static int mov_read_wide(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     return err;
 }
 
-static int mov_read_cmov(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_cmov(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
 #if CONFIG_ZLIB
-    ByteIOContext ctx;
+    AVIOContext ctx;
     uint8_t *cmov_data;
     uint8_t *moov_data; /* uncompressed data */
     long cmov_len, moov_len;
@@ -2142,7 +2142,7 @@ free_and_return:
 }
 
 /* edit list atom */
-static int mov_read_elst(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     MOVStreamContext *sc;
     int i, edit_count;
@@ -2343,7 +2343,7 @@ finish:
 static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     MOVContext *mov = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int err;
     MOVAtom atom = { AV_RL32("root") };
 
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 389667f..5259419 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -36,7 +36,7 @@
 #include <assert.h>
 
 //FIXME support 64 bit variant with wide placeholders
-static int64_t updateSize(ByteIOContext *pb, int64_t pos)
+static int64_t updateSize(AVIOContext *pb, int64_t pos)
 {
     int64_t curpos = url_ftell(pb);
     url_fseek(pb, pos, SEEK_SET);
@@ -47,7 +47,7 @@ static int64_t updateSize(ByteIOContext *pb, int64_t pos)
 }
 
 /* Chunk offset atom */
-static int mov_write_stco_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_stco_tag(AVIOContext *pb, MOVTrack *track)
 {
     int i;
     int mode64 = 0; //   use 32 bit size variant if possible
@@ -70,7 +70,7 @@ static int mov_write_stco_tag(ByteIOContext *pb, MOVTrack *track)
 }
 
 /* Sample size atom */
-static int mov_write_stsz_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_stsz_tag(AVIOContext *pb, MOVTrack *track)
 {
     int equalChunks = 1;
     int i, j, entries = 0, tst = -1, oldtst = -1;
@@ -107,7 +107,7 @@ static int mov_write_stsz_tag(ByteIOContext *pb, MOVTrack *track)
 }
 
 /* Sample to chunk atom */
-static int mov_write_stsc_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_stsc_tag(AVIOContext *pb, MOVTrack *track)
 {
     int index = 0, oldval = -1, i;
     int64_t entryPos, curpos;
@@ -137,7 +137,7 @@ static int mov_write_stsc_tag(ByteIOContext *pb, MOVTrack *track)
 }
 
 /* Sync sample atom */
-static int mov_write_stss_tag(ByteIOContext *pb, MOVTrack *track, uint32_t flag)
+static int mov_write_stss_tag(AVIOContext *pb, MOVTrack *track, uint32_t flag)
 {
     int64_t curpos, entryPos;
     int i, index = 0;
@@ -160,7 +160,7 @@ static int mov_write_stss_tag(ByteIOContext *pb, MOVTrack *track, uint32_t flag)
     return updateSize(pb, pos);
 }
 
-static int mov_write_amr_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_amr_tag(AVIOContext *pb, MOVTrack *track)
 {
     avio_put_be32(pb, 0x11); /* size */
     if (track->mode == MODE_MOV) avio_put_tag(pb, "samr");
@@ -174,7 +174,7 @@ static int mov_write_amr_tag(ByteIOContext *pb, MOVTrack *track)
     return 0x11;
 }
 
-static int mov_write_ac3_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_ac3_tag(AVIOContext *pb, MOVTrack *track)
 {
     GetBitContext gbc;
     PutBitContext pbc;
@@ -222,13 +222,13 @@ static int mov_write_ac3_tag(ByteIOContext *pb, MOVTrack *track)
  * This function writes extradata "as is".
  * Extradata must be formated like a valid atom (with size and tag)
  */
-static int mov_write_extradata_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_extradata_tag(AVIOContext *pb, MOVTrack *track)
 {
     avio_put_buffer(pb, track->enc->extradata, track->enc->extradata_size);
     return track->enc->extradata_size;
 }
 
-static int mov_write_enda_tag(ByteIOContext *pb)
+static int mov_write_enda_tag(AVIOContext *pb)
 {
     avio_put_be32(pb, 10);
     avio_put_tag(pb, "enda");
@@ -243,7 +243,7 @@ static unsigned int descrLength(unsigned int len)
     return len + 1 + i;
 }
 
-static void putDescr(ByteIOContext *pb, int tag, unsigned int size)
+static void putDescr(AVIOContext *pb, int tag, unsigned int size)
 {
     int i= descrLength(size) - size - 2;
     avio_put_byte(pb, tag);
@@ -252,7 +252,7 @@ static void putDescr(ByteIOContext *pb, int tag, unsigned int size)
     avio_put_byte(pb, size & 0x7F);
 }
 
-static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack *track) // Basic
+static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic
 {
     int64_t pos = url_ftell(pb);
     int decoderSpecificInfoLen = track->vosLen ? descrLength(track->vosLen):0;
@@ -314,7 +314,7 @@ static int mov_pcm_le_gt16(enum CodecID codec_id)
            codec_id == CODEC_ID_PCM_F64LE;
 }
 
-static int mov_write_ms_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_ms_tag(AVIOContext *pb, MOVTrack *track)
 {
     int64_t pos = url_ftell(pb);
     avio_put_be32(pb, 0);
@@ -324,7 +324,7 @@ static int mov_write_ms_tag(ByteIOContext *pb, MOVTrack *track)
     return updateSize(pb, pos);
 }
 
-static int mov_write_wave_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_wave_tag(AVIOContext *pb, MOVTrack *track)
 {
     int64_t pos = url_ftell(pb);
 
@@ -360,7 +360,7 @@ static int mov_write_wave_tag(ByteIOContext *pb, MOVTrack *track)
     return updateSize(pb, pos);
 }
 
-static int mov_write_glbl_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_glbl_tag(AVIOContext *pb, MOVTrack *track)
 {
     avio_put_be32(pb, track->vosLen+8);
     avio_put_tag(pb, "glbl");
@@ -397,7 +397,7 @@ static int mov_get_lpcm_flags(enum CodecID codec_id)
     }
 }
 
-static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track)
 {
     int64_t pos = url_ftell(pb);
     int version = 0;
@@ -490,7 +490,7 @@ static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack *track)
     return updateSize(pb, pos);
 }
 
-static int mov_write_d263_tag(ByteIOContext *pb)
+static int mov_write_d263_tag(AVIOContext *pb)
 {
     avio_put_be32(pb, 0xf); /* size */
     avio_put_tag(pb, "d263");
@@ -503,7 +503,7 @@ static int mov_write_d263_tag(ByteIOContext *pb)
 }
 
 /* TODO: No idea about these values */
-static int mov_write_svq3_tag(ByteIOContext *pb)
+static int mov_write_svq3_tag(AVIOContext *pb)
 {
     avio_put_be32(pb, 0x15);
     avio_put_tag(pb, "SMI ");
@@ -515,7 +515,7 @@ static int mov_write_svq3_tag(ByteIOContext *pb)
     return 0x15;
 }
 
-static int mov_write_avcc_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_avcc_tag(AVIOContext *pb, MOVTrack *track)
 {
     int64_t pos = url_ftell(pb);
 
@@ -526,7 +526,7 @@ static int mov_write_avcc_tag(ByteIOContext *pb, MOVTrack *track)
 }
 
 /* also used by all avid codecs (dv, imx, meridien) and their variants */
-static int mov_write_avid_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track)
 {
     int i;
     avio_put_be32(pb, 24); /* size */
@@ -738,7 +738,7 @@ static int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track)
  * Needed to make file play in iPods running newest firmware
  * goes after avcC atom in moov.trak.mdia.minf.stbl.stsd.avc1
  */
-static int mov_write_uuid_tag_ipod(ByteIOContext *pb)
+static int mov_write_uuid_tag_ipod(AVIOContext *pb)
 {
     avio_put_be32(pb, 28);
     avio_put_tag(pb, "uuid");
@@ -750,7 +750,7 @@ static int mov_write_uuid_tag_ipod(ByteIOContext *pb)
     return 28;
 }
 
-static int mov_write_subtitle_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_subtitle_tag(AVIOContext *pb, MOVTrack *track)
 {
     int64_t pos = url_ftell(pb);
     avio_put_be32(pb, 0);    /* size */
@@ -765,7 +765,7 @@ static int mov_write_subtitle_tag(ByteIOContext *pb, MOVTrack *track)
     return updateSize(pb, pos);
 }
 
-static int mov_write_pasp_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_pasp_tag(AVIOContext *pb, MOVTrack *track)
 {
     AVRational sar;
     av_reduce(&sar.num, &sar.den, track->enc->sample_aspect_ratio.num,
@@ -778,7 +778,7 @@ static int mov_write_pasp_tag(ByteIOContext *pb, MOVTrack *track)
     return 16;
 }
 
-static int mov_write_video_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_video_tag(AVIOContext *pb, MOVTrack *track)
 {
     int64_t pos = url_ftell(pb);
     char compressor_name[32];
@@ -848,7 +848,7 @@ static int mov_write_video_tag(ByteIOContext *pb, MOVTrack *track)
     return updateSize(pb, pos);
 }
 
-static int mov_write_rtp_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_rtp_tag(AVIOContext *pb, MOVTrack *track)
 {
     int64_t pos = url_ftell(pb);
     avio_put_be32(pb, 0); /* size */
@@ -868,7 +868,7 @@ static int mov_write_rtp_tag(ByteIOContext *pb, MOVTrack *track)
     return updateSize(pb, pos);
 }
 
-static int mov_write_stsd_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_stsd_tag(AVIOContext *pb, MOVTrack *track)
 {
     int64_t pos = url_ftell(pb);
     avio_put_be32(pb, 0); /* size */
@@ -886,7 +886,7 @@ static int mov_write_stsd_tag(ByteIOContext *pb, MOVTrack *track)
     return updateSize(pb, pos);
 }
 
-static int mov_write_ctts_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track)
 {
     MOVStts *ctts_entries;
     uint32_t entries = 0;
@@ -920,7 +920,7 @@ static int mov_write_ctts_tag(ByteIOContext *pb, MOVTrack *track)
 }
 
 /* Time to sample atom */
-static int mov_write_stts_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_stts_tag(AVIOContext *pb, MOVTrack *track)
 {
     MOVStts *stts_entries;
     uint32_t entries = -1;
@@ -961,7 +961,7 @@ static int mov_write_stts_tag(ByteIOContext *pb, MOVTrack *track)
     return atom_size;
 }
 
-static int mov_write_dref_tag(ByteIOContext *pb)
+static int mov_write_dref_tag(AVIOContext *pb)
 {
     avio_put_be32(pb, 28); /* size */
     avio_put_tag(pb, "dref");
@@ -975,7 +975,7 @@ static int mov_write_dref_tag(ByteIOContext *pb)
     return 28;
 }
 
-static int mov_write_stbl_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_stbl_tag(AVIOContext *pb, MOVTrack *track)
 {
     int64_t pos = url_ftell(pb);
     avio_put_be32(pb, 0); /* size */
@@ -997,7 +997,7 @@ static int mov_write_stbl_tag(ByteIOContext *pb, MOVTrack *track)
     return updateSize(pb, pos);
 }
 
-static int mov_write_dinf_tag(ByteIOContext *pb)
+static int mov_write_dinf_tag(AVIOContext *pb)
 {
     int64_t pos = url_ftell(pb);
     avio_put_be32(pb, 0); /* size */
@@ -1006,7 +1006,7 @@ static int mov_write_dinf_tag(ByteIOContext *pb)
     return updateSize(pb, pos);
 }
 
-static int mov_write_nmhd_tag(ByteIOContext *pb)
+static int mov_write_nmhd_tag(AVIOContext *pb)
 {
     avio_put_be32(pb, 12);
     avio_put_tag(pb, "nmhd");
@@ -1014,7 +1014,7 @@ static int mov_write_nmhd_tag(ByteIOContext *pb)
     return 12;
 }
 
-static int mov_write_gmhd_tag(ByteIOContext *pb)
+static int mov_write_gmhd_tag(AVIOContext *pb)
 {
     avio_put_be32(pb, 0x20);   /* size */
     avio_put_tag(pb, "gmhd");
@@ -1030,7 +1030,7 @@ static int mov_write_gmhd_tag(ByteIOContext *pb)
     return 0x20;
 }
 
-static int mov_write_smhd_tag(ByteIOContext *pb)
+static int mov_write_smhd_tag(AVIOContext *pb)
 {
     avio_put_be32(pb, 16); /* size */
     avio_put_tag(pb, "smhd");
@@ -1040,7 +1040,7 @@ static int mov_write_smhd_tag(ByteIOContext *pb)
     return 16;
 }
 
-static int mov_write_vmhd_tag(ByteIOContext *pb)
+static int mov_write_vmhd_tag(AVIOContext *pb)
 {
     avio_put_be32(pb, 0x14); /* size (always 0x14) */
     avio_put_tag(pb, "vmhd");
@@ -1049,7 +1049,7 @@ static int mov_write_vmhd_tag(ByteIOContext *pb)
     return 0x14;
 }
 
-static int mov_write_hdlr_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_hdlr_tag(AVIOContext *pb, MOVTrack *track)
 {
     const char *hdlr, *descr = NULL, *hdlr_type = NULL;
     int64_t pos = url_ftell(pb);
@@ -1092,7 +1092,7 @@ static int mov_write_hdlr_tag(ByteIOContext *pb, MOVTrack *track)
     return updateSize(pb, pos);
 }
 
-static int mov_write_hmhd_tag(ByteIOContext *pb)
+static int mov_write_hmhd_tag(AVIOContext *pb)
 {
     /* This atom must be present, but leaving the values at zero
      * seems harmless. */
@@ -1107,7 +1107,7 @@ static int mov_write_hmhd_tag(ByteIOContext *pb)
     return 28;
 }
 
-static int mov_write_minf_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_minf_tag(AVIOContext *pb, MOVTrack *track)
 {
     int64_t pos = url_ftell(pb);
     avio_put_be32(pb, 0); /* size */
@@ -1129,7 +1129,7 @@ static int mov_write_minf_tag(ByteIOContext *pb, MOVTrack *track)
     return updateSize(pb, pos);
 }
 
-static int mov_write_mdhd_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_mdhd_tag(AVIOContext *pb, MOVTrack *track)
 {
     int version = track->trackDuration < INT32_MAX ? 0 : 1;
 
@@ -1159,7 +1159,7 @@ static int mov_write_mdhd_tag(ByteIOContext *pb, MOVTrack *track)
     return 32;
 }
 
-static int mov_write_mdia_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_mdia_tag(AVIOContext *pb, MOVTrack *track)
 {
     int64_t pos = url_ftell(pb);
     avio_put_be32(pb, 0); /* size */
@@ -1170,7 +1170,7 @@ static int mov_write_mdia_tag(ByteIOContext *pb, MOVTrack *track)
     return updateSize(pb, pos);
 }
 
-static int mov_write_tkhd_tag(ByteIOContext *pb, MOVTrack *track, AVStream *st)
+static int mov_write_tkhd_tag(AVIOContext *pb, MOVTrack *track, AVStream *st)
 {
     int64_t duration = av_rescale_rnd(track->trackDuration, MOV_TIMESCALE,
                                       track->timescale, AV_ROUND_UP);
@@ -1229,7 +1229,7 @@ static int mov_write_tkhd_tag(ByteIOContext *pb, MOVTrack *track, AVStream *st)
 }
 
 // This box seems important for the psp playback ... without it the movie seems to hang
-static int mov_write_edts_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_edts_tag(AVIOContext *pb, MOVTrack *track)
 {
     avio_put_be32(pb, 0x24); /* size  */
     avio_put_tag(pb, "edts");
@@ -1247,7 +1247,7 @@ static int mov_write_edts_tag(ByteIOContext *pb, MOVTrack *track)
     return 0x24;
 }
 
-static int mov_write_tref_tag(ByteIOContext *pb, MOVTrack *track)
+static int mov_write_tref_tag(AVIOContext *pb, MOVTrack *track)
 {
     avio_put_be32(pb, 20);   // size
     avio_put_tag(pb, "tref");
@@ -1258,7 +1258,7 @@ static int mov_write_tref_tag(ByteIOContext *pb, MOVTrack *track)
 }
 
 // goes at the end of each track!  ... Critical for PSP playback ("Incompatible data" without it)
-static int mov_write_uuid_tag_psp(ByteIOContext *pb, MOVTrack *mov)
+static int mov_write_uuid_tag_psp(AVIOContext *pb, MOVTrack *mov)
 {
     avio_put_be32(pb, 0x34); /* size ... reports as 28 in mp4box! */
     avio_put_tag(pb, "uuid");
@@ -1276,7 +1276,7 @@ static int mov_write_uuid_tag_psp(ByteIOContext *pb, MOVTrack *mov)
     return 0x34;
 }
 
-static int mov_write_udta_sdp(ByteIOContext *pb, AVCodecContext *ctx, int index)
+static int mov_write_udta_sdp(AVIOContext *pb, AVCodecContext *ctx, int index)
 {
     char buf[1000] = "";
     int len;
@@ -1295,7 +1295,7 @@ static int mov_write_udta_sdp(ByteIOContext *pb, AVCodecContext *ctx, int index)
     return len + 24;
 }
 
-static int mov_write_trak_tag(ByteIOContext *pb, MOVTrack *track, AVStream *st)
+static int mov_write_trak_tag(AVIOContext *pb, MOVTrack *track, AVStream *st)
 {
     int64_t pos = url_ftell(pb);
     avio_put_be32(pb, 0); /* size */
@@ -1315,7 +1315,7 @@ static int mov_write_trak_tag(ByteIOContext *pb, MOVTrack *track, AVStream *st)
 
 #if 0
 /* TODO: Not sorted out, but not necessary either */
-static int mov_write_iods_tag(ByteIOContext *pb, MOVMuxContext *mov)
+static int mov_write_iods_tag(AVIOContext *pb, MOVMuxContext *mov)
 {
     avio_put_be32(pb, 0x15); /* size */
     avio_put_tag(pb, "iods");
@@ -1329,7 +1329,7 @@ static int mov_write_iods_tag(ByteIOContext *pb, MOVMuxContext *mov)
 }
 #endif
 
-static int mov_write_mvhd_tag(ByteIOContext *pb, MOVMuxContext *mov)
+static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov)
 {
     int maxTrackID = 1, i;
     int64_t maxTrackLenTemp, maxTrackLen = 0;
@@ -1390,7 +1390,7 @@ static int mov_write_mvhd_tag(ByteIOContext *pb, MOVMuxContext *mov)
     return 0x6c;
 }
 
-static int mov_write_itunes_hdlr_tag(ByteIOContext *pb, MOVMuxContext *mov,
+static int mov_write_itunes_hdlr_tag(AVIOContext *pb, MOVMuxContext *mov,
                                      AVFormatContext *s)
 {
     avio_put_be32(pb, 33); /* size */
@@ -1406,7 +1406,7 @@ static int mov_write_itunes_hdlr_tag(ByteIOContext *pb, MOVMuxContext *mov,
 }
 
 /* helper function to write a data tag with the specified string as data */
-static int mov_write_string_data_tag(ByteIOContext *pb, const char *data, int lang, int long_style)
+static int mov_write_string_data_tag(AVIOContext *pb, const char *data, int lang, int long_style)
 {
     if(long_style){
         int size = 16 + strlen(data);
@@ -1426,7 +1426,7 @@ static int mov_write_string_data_tag(ByteIOContext *pb, const char *data, int la
     }
 }
 
-static int mov_write_string_tag(ByteIOContext *pb, const char *name, const char *value, int lang, int long_style){
+static int mov_write_string_tag(AVIOContext *pb, const char *name, const char *value, int lang, int long_style){
     int size = 0;
     if (value && value[0]) {
         int64_t pos = url_ftell(pb);
@@ -1438,7 +1438,7 @@ static int mov_write_string_tag(ByteIOContext *pb, const char *name, const char
     return size;
 }
 
-static int mov_write_string_metadata(AVFormatContext *s, ByteIOContext *pb,
+static int mov_write_string_metadata(AVFormatContext *s, AVIOContext *pb,
                                      const char *name, const char *tag,
                                      int long_style)
 {
@@ -1463,7 +1463,7 @@ static int mov_write_string_metadata(AVFormatContext *s, ByteIOContext *pb,
 }
 
 /* iTunes track number */
-static int mov_write_trkn_tag(ByteIOContext *pb, MOVMuxContext *mov,
+static int mov_write_trkn_tag(AVIOContext *pb, MOVMuxContext *mov,
                               AVFormatContext *s)
 {
     AVMetadataTag *t = av_metadata_get(s->metadata, "track", NULL, 0);
@@ -1485,7 +1485,7 @@ static int mov_write_trkn_tag(ByteIOContext *pb, MOVMuxContext *mov,
 }
 
 /* iTunes meta data list */
-static int mov_write_ilst_tag(ByteIOContext *pb, MOVMuxContext *mov,
+static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov,
                               AVFormatContext *s)
 {
     int64_t pos = url_ftell(pb);
@@ -1513,7 +1513,7 @@ static int mov_write_ilst_tag(ByteIOContext *pb, MOVMuxContext *mov,
 }
 
 /* iTunes meta data tag */
-static int mov_write_meta_tag(ByteIOContext *pb, MOVMuxContext *mov,
+static int mov_write_meta_tag(AVIOContext *pb, MOVMuxContext *mov,
                               AVFormatContext *s)
 {
     int size = 0;
@@ -1538,7 +1538,7 @@ static int utf8len(const uint8_t *b)
     return len;
 }
 
-static int ascii_to_wc(ByteIOContext *pb, const uint8_t *b)
+static int ascii_to_wc(AVIOContext *pb, const uint8_t *b)
 {
     int val;
     while(*b){
@@ -1554,7 +1554,7 @@ static uint16_t language_code(const char *str)
     return (((str[0]-0x60) & 0x1F) << 10) + (((str[1]-0x60) & 0x1F) << 5) + ((str[2]-0x60) & 0x1F);
 }
 
-static int mov_write_3gp_udta_tag(ByteIOContext *pb, AVFormatContext *s,
+static int mov_write_3gp_udta_tag(AVIOContext *pb, AVFormatContext *s,
                                   const char *tag, const char *str)
 {
     int64_t pos = url_ftell(pb);
@@ -1576,7 +1576,7 @@ static int mov_write_3gp_udta_tag(ByteIOContext *pb, AVFormatContext *s,
     return updateSize(pb, pos);
 }
 
-static int mov_write_chpl_tag(ByteIOContext *pb, AVFormatContext *s)
+static int mov_write_chpl_tag(AVIOContext *pb, AVFormatContext *s)
 {
     int64_t pos = url_ftell(pb);
     int i, nb_chapters = FFMIN(s->nb_chapters, 255);
@@ -1602,10 +1602,10 @@ static int mov_write_chpl_tag(ByteIOContext *pb, AVFormatContext *s)
     return updateSize(pb, pos);
 }
 
-static int mov_write_udta_tag(ByteIOContext *pb, MOVMuxContext *mov,
+static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov,
                               AVFormatContext *s)
 {
-    ByteIOContext *pb_buf;
+    AVIOContext *pb_buf;
     int i, ret, size;
     uint8_t *buf;
 
@@ -1655,7 +1655,7 @@ static int mov_write_udta_tag(ByteIOContext *pb, MOVMuxContext *mov,
     return 0;
 }
 
-static void mov_write_psp_udta_tag(ByteIOContext *pb,
+static void mov_write_psp_udta_tag(AVIOContext *pb,
                                   const char *str, const char *lang, int type)
 {
     int len = utf8len(str)+1;
@@ -1668,7 +1668,7 @@ static void mov_write_psp_udta_tag(ByteIOContext *pb,
     ascii_to_wc(pb, str);
 }
 
-static int mov_write_uuidusmt_tag(ByteIOContext *pb, AVFormatContext *s)
+static int mov_write_uuidusmt_tag(AVIOContext *pb, AVFormatContext *s)
 {
     AVMetadataTag *title = av_metadata_get(s->metadata, "title", NULL, 0);
     int64_t pos, pos2;
@@ -1706,7 +1706,7 @@ static int mov_write_uuidusmt_tag(ByteIOContext *pb, AVFormatContext *s)
     return 0;
 }
 
-static int mov_write_moov_tag(ByteIOContext *pb, MOVMuxContext *mov,
+static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov,
                               AVFormatContext *s)
 {
     int i;
@@ -1750,7 +1750,7 @@ static int mov_write_moov_tag(ByteIOContext *pb, MOVMuxContext *mov,
     return updateSize(pb, pos);
 }
 
-static int mov_write_mdat_tag(ByteIOContext *pb, MOVMuxContext *mov)
+static int mov_write_mdat_tag(AVIOContext *pb, MOVMuxContext *mov)
 {
     avio_put_be32(pb, 8);    // placeholder for extended size field (64 bit)
     avio_put_tag(pb, mov->mode == MODE_MOV ? "wide" : "free");
@@ -1762,7 +1762,7 @@ static int mov_write_mdat_tag(ByteIOContext *pb, MOVMuxContext *mov)
 }
 
 /* TODO: This needs to be more general */
-static int mov_write_ftyp_tag(ByteIOContext *pb, AVFormatContext *s)
+static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s)
 {
     MOVMuxContext *mov = s->priv_data;
     int64_t pos = url_ftell(pb);
@@ -1818,7 +1818,7 @@ static int mov_write_ftyp_tag(ByteIOContext *pb, AVFormatContext *s)
     return updateSize(pb, pos);
 }
 
-static void mov_write_uuidprof_tag(ByteIOContext *pb, AVFormatContext *s)
+static void mov_write_uuidprof_tag(AVIOContext *pb, AVFormatContext *s)
 {
     AVCodecContext *VideoCodec = s->streams[0]->codec;
     AVCodecContext *AudioCodec = s->streams[1]->codec;
@@ -1903,7 +1903,7 @@ static int mov_parse_mpeg2_frame(AVPacket *pkt, uint32_t *flags)
 int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     MOVMuxContext *mov = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     MOVTrack *trk = &mov->tracks[pkt->stream_index];
     AVCodecContext *enc = trk->enc;
     unsigned int samplesInChunk = 0;
@@ -2040,7 +2040,7 @@ static void mov_create_chapter_track(AVFormatContext *s, int tracknum)
 
 static int mov_write_header(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     MOVMuxContext *mov = s->priv_data;
     int i, hint_track = 0;
 
@@ -2192,7 +2192,7 @@ static int mov_write_header(AVFormatContext *s)
 static int mov_write_trailer(AVFormatContext *s)
 {
     MOVMuxContext *mov = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int res = 0;
     int i;
 
diff --git a/libavformat/movenchint.c b/libavformat/movenchint.c
index ef07e46..8775bd0 100644
--- a/libavformat/movenchint.c
+++ b/libavformat/movenchint.c
@@ -245,7 +245,7 @@ static int find_sample_match(const uint8_t *data, int len,
 }
 
 static void output_immediate(const uint8_t *data, int size,
-                             ByteIOContext *out, int *entries)
+                             AVIOContext *out, int *entries)
 {
     while (size > 0) {
         int len = size;
@@ -264,7 +264,7 @@ static void output_immediate(const uint8_t *data, int size,
     }
 }
 
-static void output_match(ByteIOContext *out, int match_sample,
+static void output_match(AVIOContext *out, int match_sample,
                          int match_offset, int match_len, int *entries)
 {
     avio_put_byte(out, 2); /* sample constructor */
@@ -278,7 +278,7 @@ static void output_match(ByteIOContext *out, int match_sample,
 }
 
 static void describe_payload(const uint8_t *data, int size,
-                             ByteIOContext *out, int *entries,
+                             AVIOContext *out, int *entries,
                              HintSampleQueue *queue)
 {
     /* Describe the payload using different constructors */
@@ -309,7 +309,7 @@ static void describe_payload(const uint8_t *data, int size,
  * @param pts pointer where the timestamp for the written RTP hint is stored
  * @return the number of RTP packets in the written hint
  */
-static int write_hint_packets(ByteIOContext *out, const uint8_t *data,
+static int write_hint_packets(AVIOContext *out, const uint8_t *data,
                               int size, MOVTrack *trk, int64_t *pts)
 {
     int64_t curpos;
@@ -392,7 +392,7 @@ int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
     AVFormatContext *rtp_ctx = trk->rtp_ctx;
     uint8_t *buf = NULL;
     int size;
-    ByteIOContext *hintbuf = NULL;
+    AVIOContext *hintbuf = NULL;
     AVPacket hint_pkt;
     int ret = 0, count;
 
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index f2b7d49..91c6ae7 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -93,8 +93,8 @@ static int id3v2_put_ttag(AVFormatContext *s, const char *str1, const char *str2
 {
     int len;
     uint8_t *pb;
-    int (*put)(ByteIOContext*, const char*);
-    ByteIOContext *dyn_buf;
+    int (*put)(AVIOContext*, const char*);
+    AVIOContext *dyn_buf;
     if (url_open_dyn_buf(&dyn_buf) < 0)
         return AVERROR(ENOMEM);
 
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index 7f685c5..3ead5e9 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -117,7 +117,7 @@ static inline int64_t gb_get_v(GetBitContext *gb)
     return v;
 }
 
-static void mpc8_get_chunk_header(ByteIOContext *pb, int *tag, int64_t *size)
+static void mpc8_get_chunk_header(AVIOContext *pb, int *tag, int64_t *size)
 {
     int64_t pos;
     pos = url_ftell(pb);
@@ -171,7 +171,7 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
 
 static void mpc8_handle_chunk(AVFormatContext *s, int tag, int64_t chunk_pos, int64_t size)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t pos, off;
 
     switch(tag){
@@ -189,7 +189,7 @@ static void mpc8_handle_chunk(AVFormatContext *s, int tag, int64_t chunk_pos, in
 static int mpc8_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     MPCContext *c = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     int tag = 0;
     int64_t size, pos;
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index e31134b..34f80be 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -124,7 +124,7 @@ static int mpegps_read_header(AVFormatContext *s,
     return 0;
 }
 
-static int64_t get_pts(ByteIOContext *pb, int c)
+static int64_t get_pts(AVIOContext *pb, int c)
 {
     uint8_t buf[5];
 
@@ -134,7 +134,7 @@ static int64_t get_pts(ByteIOContext *pb, int c)
     return ff_parse_pes_pts(buf);
 }
 
-static int find_next_start_code(ByteIOContext *pb, int *size_ptr,
+static int find_next_start_code(AVIOContext *pb, int *size_ptr,
                                 int32_t *header_state)
 {
     unsigned int state, v;
@@ -163,7 +163,7 @@ static int find_next_start_code(ByteIOContext *pb, int *size_ptr,
 
 #if 0 /* unused, remove? */
 /* XXX: optimize */
-static int find_prev_start_code(ByteIOContext *pb, int *size_ptr)
+static int find_prev_start_code(AVIOContext *pb, int *size_ptr)
 {
     int64_t pos, pos_start;
     int max_size, start_code;
@@ -202,7 +202,7 @@ static int find_prev_start_code(ByteIOContext *pb, int *size_ptr)
  *
  * @return number of bytes occupied by PSM in the bitstream
  */
-static long mpegps_psm_parse(MpegDemuxContext *m, ByteIOContext *pb)
+static long mpegps_psm_parse(MpegDemuxContext *m, AVIOContext *pb)
 {
     int psm_length, ps_info_length, es_map_length;
 
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index 19ca65f..2cbc3b8 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -491,7 +491,7 @@ static int mpeg_mux_init(AVFormatContext *ctx)
     return AVERROR(ENOMEM);
 }
 
-static inline void put_timestamp(ByteIOContext *pb, int id, int64_t timestamp)
+static inline void put_timestamp(AVIOContext *pb, int id, int64_t timestamp)
 {
     avio_put_byte(pb,
              (id << 4) |
@@ -613,7 +613,7 @@ static int get_packet_payload_size(AVFormatContext *ctx, int stream_index,
 #endif
 
 /* Write an MPEG padding packet header. */
-static void put_padding_packet(AVFormatContext *ctx, ByteIOContext *pb,int packet_bytes)
+static void put_padding_packet(AVFormatContext *ctx, AVIOContext *pb,int packet_bytes)
 {
     MpegMuxContext *s = ctx->priv_data;
     int i;
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 0ba4b33..d922a06 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -851,7 +851,7 @@ static int mp4_read_iods(AVFormatContext *s, const uint8_t *buf, unsigned size,
                          int *es_id, uint8_t **dec_config_descr,
                          int *dec_config_descr_size)
 {
-    ByteIOContext pb;
+    AVIOContext pb;
     int tag;
     unsigned len;
 
@@ -913,7 +913,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
         get16(pp, desc_end);
         if (st->codec->codec_id == CODEC_ID_AAC_LATM &&
             mp4_dec_config_descr_len && mp4_es_id == pid) {
-            ByteIOContext pb;
+            AVIOContext pb;
             init_put_byte(&pb, mp4_dec_config_descr,
                           mp4_dec_config_descr_len, 0, NULL, NULL, NULL, NULL);
             ff_mp4_read_dec_config_descr(fc, st, &pb);
@@ -1307,7 +1307,7 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
    get_packet_size() ?) */
 static int mpegts_resync(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int c, i;
 
     for(i = 0;i < MAX_RESYNC_SIZE; i++) {
@@ -1327,7 +1327,7 @@ static int mpegts_resync(AVFormatContext *s)
 /* return -1 if error or EOF. Return 0 if OK. */
 static int read_packet(AVFormatContext *s, uint8_t *buf, int raw_packet_size)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int skip, len;
 
     for(;;) {
@@ -1439,7 +1439,7 @@ static int mpegts_read_header(AVFormatContext *s,
                               AVFormatParameters *ap)
 {
     MpegTSContext *ts = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     uint8_t buf[5*1024];
     int len;
     int64_t pos;
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index e0d9da6..7d2973e 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -593,7 +593,7 @@ static void retransmit_si_info(AVFormatContext *s)
     }
 }
 
-static int64_t get_pcr(const MpegTSWrite *ts, ByteIOContext *pb)
+static int64_t get_pcr(const MpegTSWrite *ts, AVIOContext *pb)
 {
     return av_rescale(url_ftell(pb) + 11, 8 * PCR_TIME_BASE, ts->mux_rate) +
            ts->first_pcr;
diff --git a/libavformat/msnwc_tcp.c b/libavformat/msnwc_tcp.c
index 08b8454..13aabcd 100644
--- a/libavformat/msnwc_tcp.c
+++ b/libavformat/msnwc_tcp.c
@@ -71,7 +71,7 @@ static int msnwc_tcp_probe(AVProbeData *p)
 
 static int msnwc_tcp_read_header(AVFormatContext *ctx, AVFormatParameters *ap)
 {
-    ByteIOContext *pb = ctx->pb;
+    AVIOContext *pb = ctx->pb;
     AVCodecContext *codec;
     AVStream *st;
 
@@ -100,7 +100,7 @@ static int msnwc_tcp_read_header(AVFormatContext *ctx, AVFormatParameters *ap)
 
 static int msnwc_tcp_read_packet(AVFormatContext *ctx, AVPacket *pkt)
 {
-    ByteIOContext *pb = ctx->pb;
+    AVIOContext *pb = ctx->pb;
     uint16_t keyframe;
     uint32_t size, timestamp;
 
diff --git a/libavformat/mtv.c b/libavformat/mtv.c
index aacc7a4..f46d914 100644
--- a/libavformat/mtv.c
+++ b/libavformat/mtv.c
@@ -79,7 +79,7 @@ static int mtv_probe(AVProbeData *p)
 static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     MTVDemuxContext *mtv = s->priv_data;
-    ByteIOContext   *pb  = s->pb;
+    AVIOContext   *pb  = s->pb;
     AVStream        *st;
     unsigned int    audio_subsegments;
 
@@ -156,7 +156,7 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap)
 static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     MTVDemuxContext *mtv = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int ret;
 #if !HAVE_BIGENDIAN
     int i;
diff --git a/libavformat/mvi.c b/libavformat/mvi.c
index e7ef59b..f09490d 100644
--- a/libavformat/mvi.c
+++ b/libavformat/mvi.c
@@ -27,7 +27,7 @@
 #define MVI_VIDEO_STREAM_INDEX 1
 
 typedef struct MviDemuxContext {
-    unsigned int (*get_int)(ByteIOContext *);
+    unsigned int (*get_int)(AVIOContext *);
     uint32_t audio_data_size;
     uint64_t audio_size_counter;
     uint64_t audio_frame_size;
@@ -38,7 +38,7 @@ typedef struct MviDemuxContext {
 static int read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     MviDemuxContext *mvi = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *ast, *vst;
     unsigned int version, frames_count, msecs_per_frame, player_version;
 
@@ -100,7 +100,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     int ret, count;
     MviDemuxContext *mvi = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     if (mvi->video_frame_size == 0) {
         mvi->video_frame_size = (mvi->get_int)(pb);
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index dd981a5..1e73e6d 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -140,7 +140,7 @@ enum MXFWrappingScheme {
     Clip,
 };
 
-typedef int MXFMetadataReadFunc(void *arg, ByteIOContext *pb, int tag, int size, UID uid);
+typedef int MXFMetadataReadFunc(void *arg, AVIOContext *pb, int tag, int size, UID uid);
 
 typedef struct {
     const UID key;
@@ -161,7 +161,7 @@ static const uint8_t mxf_sony_mpeg4_extradata[]            = { 0x06,0x0e,0x2b,0x
 
 #define IS_KLV_KEY(x, y) (!memcmp(x, y, sizeof(y)))
 
-static int64_t klv_decode_ber_length(ByteIOContext *pb)
+static int64_t klv_decode_ber_length(AVIOContext *pb)
 {
     uint64_t size = avio_get_byte(pb);
     if (size & 0x80) { /* long form */
@@ -176,7 +176,7 @@ static int64_t klv_decode_ber_length(ByteIOContext *pb)
     return size;
 }
 
-static int mxf_read_sync(ByteIOContext *pb, const uint8_t *key, unsigned size)
+static int mxf_read_sync(AVIOContext *pb, const uint8_t *key, unsigned size)
 {
     int i, b;
     for (i = 0; i < size && !url_feof(pb); i++) {
@@ -189,7 +189,7 @@ static int mxf_read_sync(ByteIOContext *pb, const uint8_t *key, unsigned size)
     return i == size;
 }
 
-static int klv_read_packet(KLVPacket *klv, ByteIOContext *pb)
+static int klv_read_packet(KLVPacket *klv, AVIOContext *pb)
 {
     if (!mxf_read_sync(pb, mxf_klv_key, 4))
         return -1;
@@ -215,7 +215,7 @@ static int mxf_get_stream_index(AVFormatContext *s, KLVPacket *klv)
 }
 
 /* XXX: use AVBitStreamFilter */
-static int mxf_get_d10_aes3_packet(ByteIOContext *pb, AVStream *st, AVPacket *pkt, int64_t length)
+static int mxf_get_d10_aes3_packet(AVIOContext *pb, AVStream *st, AVPacket *pkt, int64_t length)
 {
     const uint8_t *buf_ptr, *end_ptr;
     uint8_t *data_ptr;
@@ -246,7 +246,7 @@ static int mxf_decrypt_triplet(AVFormatContext *s, AVPacket *pkt, KLVPacket *klv
 {
     static const uint8_t checkv[16] = {0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b};
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t end = url_ftell(pb) + klv->length;
     uint64_t size;
     uint64_t orig_size;
@@ -344,7 +344,7 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
     return AVERROR_EOF;
 }
 
-static int mxf_read_primer_pack(void *arg, ByteIOContext *pb, int tag, int size, UID uid)
+static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, UID uid)
 {
     MXFContext *mxf = arg;
     int item_num = avio_get_be32(pb);
@@ -376,7 +376,7 @@ static int mxf_add_metadata_set(MXFContext *mxf, void *metadata_set)
     return 0;
 }
 
-static int mxf_read_cryptographic_context(void *arg, ByteIOContext *pb, int tag, int size, UID uid)
+static int mxf_read_cryptographic_context(void *arg, AVIOContext *pb, int tag, int size, UID uid)
 {
     MXFCryptoContext *cryptocontext = arg;
     if (size != 16)
@@ -386,7 +386,7 @@ static int mxf_read_cryptographic_context(void *arg, ByteIOContext *pb, int tag,
     return 0;
 }
 
-static int mxf_read_content_storage(void *arg, ByteIOContext *pb, int tag, int size, UID uid)
+static int mxf_read_content_storage(void *arg, AVIOContext *pb, int tag, int size, UID uid)
 {
     MXFContext *mxf = arg;
     switch (tag) {
@@ -404,7 +404,7 @@ static int mxf_read_content_storage(void *arg, ByteIOContext *pb, int tag, int s
     return 0;
 }
 
-static int mxf_read_source_clip(void *arg, ByteIOContext *pb, int tag, int size, UID uid)
+static int mxf_read_source_clip(void *arg, AVIOContext *pb, int tag, int size, UID uid)
 {
     MXFStructuralComponent *source_clip = arg;
     switch(tag) {
@@ -426,7 +426,7 @@ static int mxf_read_source_clip(void *arg, ByteIOContext *pb, int tag, int size,
     return 0;
 }
 
-static int mxf_read_material_package(void *arg, ByteIOContext *pb, int tag, int size, UID uid)
+static int mxf_read_material_package(void *arg, AVIOContext *pb, int tag, int size, UID uid)
 {
     MXFPackage *package = arg;
     switch(tag) {
@@ -444,7 +444,7 @@ static int mxf_read_material_package(void *arg, ByteIOContext *pb, int tag, int
     return 0;
 }
 
-static int mxf_read_track(void *arg, ByteIOContext *pb, int tag, int size, UID uid)
+static int mxf_read_track(void *arg, AVIOContext *pb, int tag, int size, UID uid)
 {
     MXFTrack *track = arg;
     switch(tag) {
@@ -465,7 +465,7 @@ static int mxf_read_track(void *arg, ByteIOContext *pb, int tag, int size, UID u
     return 0;
 }
 
-static int mxf_read_sequence(void *arg, ByteIOContext *pb, int tag, int size, UID uid)
+static int mxf_read_sequence(void *arg, AVIOContext *pb, int tag, int size, UID uid)
 {
     MXFSequence *sequence = arg;
     switch(tag) {
@@ -489,7 +489,7 @@ static int mxf_read_sequence(void *arg, ByteIOContext *pb, int tag, int size, UI
     return 0;
 }
 
-static int mxf_read_source_package(void *arg, ByteIOContext *pb, int tag, int size, UID uid)
+static int mxf_read_source_package(void *arg, AVIOContext *pb, int tag, int size, UID uid)
 {
     MXFPackage *package = arg;
     switch(tag) {
@@ -515,7 +515,7 @@ static int mxf_read_source_package(void *arg, ByteIOContext *pb, int tag, int si
     return 0;
 }
 
-static int mxf_read_index_table_segment(void *arg, ByteIOContext *pb, int tag, int size, UID uid)
+static int mxf_read_index_table_segment(void *arg, AVIOContext *pb, int tag, int size, UID uid)
 {
     switch(tag) {
     case 0x3F05: av_dlog(NULL, "EditUnitByteCount %d\n", avio_get_be32(pb)); break;
@@ -528,7 +528,7 @@ static int mxf_read_index_table_segment(void *arg, ByteIOContext *pb, int tag, i
     return 0;
 }
 
-static void mxf_read_pixel_layout(ByteIOContext *pb, MXFDescriptor *descriptor)
+static void mxf_read_pixel_layout(AVIOContext *pb, MXFDescriptor *descriptor)
 {
     int code, value, ofs = 0;
     char layout[16] = {0};
@@ -547,7 +547,7 @@ static void mxf_read_pixel_layout(ByteIOContext *pb, MXFDescriptor *descriptor)
     ff_mxf_decode_pixel_layout(layout, &descriptor->pix_fmt);
 }
 
-static int mxf_read_generic_descriptor(void *arg, ByteIOContext *pb, int tag, int size, UID uid)
+static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int size, UID uid)
 {
     MXFDescriptor *descriptor = arg;
     switch(tag) {
@@ -864,7 +864,7 @@ static const MXFMetadataReadTableEntry mxf_metadata_read_table[] = {
 
 static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, MXFMetadataReadFunc *read_child, int ctx_size, enum MXFMetadataSetType type)
 {
-    ByteIOContext *pb = mxf->fc->pb;
+    AVIOContext *pb = mxf->fc->pb;
     MXFMetadataSet *ctx = ctx_size ? av_mallocz(ctx_size) : mxf;
     uint64_t klv_end = url_ftell(pb) + klv->length;
 
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 7a4f87f..2af3271 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -305,7 +305,7 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = {
     { 0x3D0A, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x03,0x02,0x01,0x00,0x00,0x00}}, /* Block Align */
 };
 
-static void mxf_write_uuid(ByteIOContext *pb, enum MXFMetadataSetType type, int value)
+static void mxf_write_uuid(AVIOContext *pb, enum MXFMetadataSetType type, int value)
 {
     avio_put_buffer(pb, uuid_base, 12);
     avio_put_be16(pb, type);
@@ -321,7 +321,7 @@ static void mxf_write_umid(AVFormatContext *s, int type)
     avio_put_byte(s->pb, type);
 }
 
-static void mxf_write_refs_count(ByteIOContext *pb, int ref_count)
+static void mxf_write_refs_count(AVIOContext *pb, int ref_count)
 {
     avio_put_be32(pb, ref_count);
     avio_put_be32(pb, 16);
@@ -335,7 +335,7 @@ static int klv_ber_length(uint64_t len)
         return (av_log2(len) >> 3) + 2;
 }
 
-static int klv_encode_ber_length(ByteIOContext *pb, uint64_t len)
+static int klv_encode_ber_length(AVIOContext *pb, uint64_t len)
 {
     // Determine the best BER size
     int size;
@@ -356,7 +356,7 @@ static int klv_encode_ber_length(ByteIOContext *pb, uint64_t len)
     return 0;
 }
 
-static void klv_encode_ber4_length(ByteIOContext *pb, int len)
+static void klv_encode_ber4_length(AVIOContext *pb, int len)
 {
     avio_put_byte(pb, 0x80 + 3);
     avio_put_be24(pb, len);
@@ -376,7 +376,7 @@ static int mxf_get_essence_container_ul_index(enum CodecID id)
 
 static void mxf_write_primer_pack(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int local_tag_number, i = 0;
 
     local_tag_number = FF_ARRAY_ELEMS(mxf_local_tag_batch);
@@ -393,13 +393,13 @@ static void mxf_write_primer_pack(AVFormatContext *s)
     }
 }
 
-static void mxf_write_local_tag(ByteIOContext *pb, int size, int tag)
+static void mxf_write_local_tag(AVIOContext *pb, int size, int tag)
 {
     avio_put_be16(pb, tag);
     avio_put_be16(pb, size);
 }
 
-static void mxf_write_metadata_key(ByteIOContext *pb, unsigned int value)
+static void mxf_write_metadata_key(AVIOContext *pb, unsigned int value)
 {
     avio_put_buffer(pb, header_metadata_key, 13);
     avio_put_be24(pb, value);
@@ -429,7 +429,7 @@ static const MXFCodecUL *mxf_get_data_definition_ul(int type)
 static void mxf_write_essence_container_refs(AVFormatContext *s)
 {
     MXFContext *c = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int i;
 
     mxf_write_refs_count(pb, c->essence_container_count);
@@ -443,7 +443,7 @@ static void mxf_write_essence_container_refs(AVFormatContext *s)
 static void mxf_write_preface(AVFormatContext *s)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     mxf_write_metadata_key(pb, 0x012f00);
     PRINT_KEY(s, "preface key", pb->buf_ptr - 16);
@@ -487,7 +487,7 @@ static void mxf_write_preface(AVFormatContext *s)
 /*
  * Write a local tag containing an ascii string as utf-16
  */
-static void mxf_write_local_tag_utf16(ByteIOContext *pb, int tag, const char *value)
+static void mxf_write_local_tag_utf16(AVIOContext *pb, int tag, const char *value)
 {
     int i, size = strlen(value);
     mxf_write_local_tag(pb, size*2, tag);
@@ -498,7 +498,7 @@ static void mxf_write_local_tag_utf16(ByteIOContext *pb, int tag, const char *va
 static void mxf_write_identification(AVFormatContext *s)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     const char *company = "FFmpeg";
     const char *product = "OP1a Muxer";
     const char *version;
@@ -536,7 +536,7 @@ static void mxf_write_identification(AVFormatContext *s)
 
 static void mxf_write_content_storage(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     mxf_write_metadata_key(pb, 0x011800);
     PRINT_KEY(s, "content storage key", pb->buf_ptr - 16);
@@ -562,7 +562,7 @@ static void mxf_write_content_storage(AVFormatContext *s)
 static void mxf_write_track(AVFormatContext *s, AVStream *st, enum MXFMetadataSetType type)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     MXFStreamContext *sc = st->priv_data;
 
     mxf_write_metadata_key(pb, 0x013b00);
@@ -603,7 +603,7 @@ static const uint8_t smpte_12m_timecode_track_data_ul[] = { 0x06,0x0E,0x2B,0x34,
 static void mxf_write_common_fields(AVFormatContext *s, AVStream *st)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     // find data define uls
     mxf_write_local_tag(pb, 16, 0x0201);
@@ -622,7 +622,7 @@ static void mxf_write_common_fields(AVFormatContext *s, AVStream *st)
 static void mxf_write_sequence(AVFormatContext *s, AVStream *st, enum MXFMetadataSetType type)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     enum MXFMetadataSetType component;
 
     mxf_write_metadata_key(pb, 0x010f00);
@@ -650,7 +650,7 @@ static void mxf_write_sequence(AVFormatContext *s, AVStream *st, enum MXFMetadat
 static void mxf_write_timecode_component(AVFormatContext *s, AVStream *st, enum MXFMetadataSetType type)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     mxf_write_metadata_key(pb, 0x011400);
     klv_encode_ber_length(pb, 75);
@@ -677,7 +677,7 @@ static void mxf_write_timecode_component(AVFormatContext *s, AVStream *st, enum
 
 static void mxf_write_structural_component(AVFormatContext *s, AVStream *st, enum MXFMetadataSetType type)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int i;
 
     mxf_write_metadata_key(pb, 0x011100);
@@ -714,7 +714,7 @@ static void mxf_write_structural_component(AVFormatContext *s, AVStream *st, enu
 static void mxf_write_multi_descriptor(AVFormatContext *s)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     const uint8_t *ul;
     int i;
 
@@ -752,7 +752,7 @@ static void mxf_write_generic_desc(AVFormatContext *s, AVStream *st, const UID k
 {
     MXFContext *mxf = s->priv_data;
     MXFStreamContext *sc = st->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     avio_put_buffer(pb, key, 16);
     klv_encode_ber4_length(pb, size+20+8+12+20);
@@ -780,7 +780,7 @@ static const UID mxf_generic_sound_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0
 static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID key, unsigned size)
 {
     MXFStreamContext *sc = st->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int stored_height = (st->codec->height+15)/16*16;
     int display_height;
     int f1, f2;
@@ -856,7 +856,7 @@ static void mxf_write_cdci_desc(AVFormatContext *s, AVStream *st)
 
 static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int profile_and_level = (st->codec->profile<<4) | st->codec->level;
 
     mxf_write_cdci_common(s, st, mxf_mpegvideo_descriptor_key, 8+5);
@@ -874,7 +874,7 @@ static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st)
 
 static void mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st, const UID key, unsigned size)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     mxf_write_generic_desc(s, st, key, size+5+12+8+8);
 
@@ -896,7 +896,7 @@ static void mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st, con
 
 static void mxf_write_wav_common(AVFormatContext *s, AVStream *st, const UID key, unsigned size)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     mxf_write_generic_sound_common(s, st, key, size+6+8);
 
@@ -926,7 +926,7 @@ static void mxf_write_generic_sound_desc(AVFormatContext *s, AVStream *st)
 static void mxf_write_package(AVFormatContext *s, enum MXFMetadataSetType type)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int i, track_count = s->nb_streams+1;
 
     if (type == MaterialPackage) {
@@ -996,7 +996,7 @@ static void mxf_write_package(AVFormatContext *s, enum MXFMetadataSetType type)
 
 static int mxf_write_essence_container_data(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     mxf_write_metadata_key(pb, 0x012300);
     klv_encode_ber_length(pb, 72);
@@ -1039,7 +1039,7 @@ static unsigned klv_fill_size(uint64_t size)
 static void mxf_write_index_table_segment(AVFormatContext *s)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int i, j, temporal_reordering = 0;
     int key_index = mxf->last_key_index;
 
@@ -1187,7 +1187,7 @@ static void mxf_write_partition(AVFormatContext *s, int bodysid,
                                 const uint8_t *key, int write_metadata)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t header_byte_count_offset;
     unsigned index_byte_count = 0;
     uint64_t partition_offset = url_ftell(pb);
@@ -1557,7 +1557,7 @@ static uint32_t ff_framenum_to_12m_time_code(unsigned frame, int drop, int fps)
 static void mxf_write_system_item(AVFormatContext *s)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned frame;
     uint32_t time_code;
 
@@ -1598,7 +1598,7 @@ static void mxf_write_system_item(AVFormatContext *s)
 static void mxf_write_d10_video_packet(AVFormatContext *s, AVStream *st, AVPacket *pkt)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int packet_size = (uint64_t)st->codec->bit_rate*mxf->time_base.num /
         (8*mxf->time_base.den); // frame size
     int pad;
@@ -1628,7 +1628,7 @@ static void mxf_write_d10_video_packet(AVFormatContext *s, AVStream *st, AVPacke
 static void mxf_write_d10_audio_packet(AVFormatContext *s, AVStream *st, AVPacket *pkt)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int frame_size = pkt->size / st->codec->block_align;
     uint8_t *samples = pkt->data;
     uint8_t *end = pkt->data + pkt->size;
@@ -1660,7 +1660,7 @@ static void mxf_write_d10_audio_packet(AVFormatContext *s, AVStream *st, AVPacke
 static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st = s->streams[pkt->stream_index];
     MXFStreamContext *sc = st->priv_data;
     MXFIndexEntry ie = {0};
@@ -1739,7 +1739,7 @@ static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt)
 static void mxf_write_random_index_pack(AVFormatContext *s)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     uint64_t pos = url_ftell(pb);
     int i;
 
@@ -1766,7 +1766,7 @@ static void mxf_write_random_index_pack(AVFormatContext *s)
 static int mxf_write_footer(AVFormatContext *s)
 {
     MXFContext *mxf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     mxf->duration = mxf->last_indexed_edit_unit + mxf->edit_units_count;
 
diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index e96e689..d71c181 100644
--- a/libavformat/nsvdec.c
+++ b/libavformat/nsvdec.c
@@ -221,7 +221,7 @@ static int nsv_read_chunk(AVFormatContext *s, int fill_header);
 static int nsv_resync(AVFormatContext *s)
 {
     NSVContext *nsv = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     uint32_t v = 0;
     int i;
 
@@ -266,7 +266,7 @@ static int nsv_resync(AVFormatContext *s)
 static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     NSVContext *nsv = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned int file_size, size;
     int64_t duration;
     int strings_size;
@@ -387,7 +387,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap)
 static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     NSVContext *nsv = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     uint32_t vtag, atag;
     uint16_t vwidth, vheight;
     AVRational framerate;
@@ -537,7 +537,7 @@ static int nsv_read_header(AVFormatContext *s, AVFormatParameters *ap)
 static int nsv_read_chunk(AVFormatContext *s, int fill_header)
 {
     NSVContext *nsv = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st[2] = {NULL, NULL};
     NSVStream *nst;
     AVPacket *pkt;
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 787b96d..ac43ad3 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -35,7 +35,7 @@
 #define NUT_MAX_STREAMS 256    /* arbitrary sanity check value */
 #endif
 
-static int get_str(ByteIOContext *bc, char *string, unsigned int maxlen){
+static int get_str(AVIOContext *bc, char *string, unsigned int maxlen){
     unsigned int len= ff_get_v(bc);
 
     if(len && maxlen)
@@ -54,14 +54,14 @@ static int get_str(ByteIOContext *bc, char *string, unsigned int maxlen){
         return 0;
 }
 
-static int64_t get_s(ByteIOContext *bc){
+static int64_t get_s(AVIOContext *bc){
     int64_t v = ff_get_v(bc) + 1;
 
     if (v&1) return -(v>>1);
     else     return  (v>>1);
 }
 
-static uint64_t get_fourcc(ByteIOContext *bc){
+static uint64_t get_fourcc(AVIOContext *bc){
     unsigned int len= ff_get_v(bc);
 
     if     (len==2) return avio_get_le16(bc);
@@ -70,21 +70,21 @@ static uint64_t get_fourcc(ByteIOContext *bc){
 }
 
 #ifdef TRACE
-static inline uint64_t get_v_trace(ByteIOContext *bc, char *file, char *func, int line){
+static inline uint64_t get_v_trace(AVIOContext *bc, char *file, char *func, int line){
     uint64_t v= ff_get_v(bc);
 
     av_log(NULL, AV_LOG_DEBUG, "get_v %5"PRId64" / %"PRIX64" in %s %s:%d\n", v, v, file, func, line);
     return v;
 }
 
-static inline int64_t get_s_trace(ByteIOContext *bc, char *file, char *func, int line){
+static inline int64_t get_s_trace(AVIOContext *bc, char *file, char *func, int line){
     int64_t v= get_s(bc);
 
     av_log(NULL, AV_LOG_DEBUG, "get_s %5"PRId64" / %"PRIX64" in %s %s:%d\n", v, v, file, func, line);
     return v;
 }
 
-static inline uint64_t get_vb_trace(ByteIOContext *bc, char *file, char *func, int line){
+static inline uint64_t get_vb_trace(AVIOContext *bc, char *file, char *func, int line){
     uint64_t v= get_vb(bc);
 
     av_log(NULL, AV_LOG_DEBUG, "get_vb %5"PRId64" / %"PRIX64" in %s %s:%d\n", v, v, file, func, line);
@@ -95,7 +95,7 @@ static inline uint64_t get_vb_trace(ByteIOContext *bc, char *file, char *func, i
 #define get_vb(bc)  get_vb_trace(bc, __FILE__, __PRETTY_FUNCTION__, __LINE__)
 #endif
 
-static int get_packetheader(NUTContext *nut, ByteIOContext *bc, int calculate_checksum, uint64_t startcode)
+static int get_packetheader(NUTContext *nut, AVIOContext *bc, int calculate_checksum, uint64_t startcode)
 {
     int64_t size;
 //    start= url_ftell(bc) - 8;
@@ -115,7 +115,7 @@ static int get_packetheader(NUTContext *nut, ByteIOContext *bc, int calculate_ch
     return size;
 }
 
-static uint64_t find_any_startcode(ByteIOContext *bc, int64_t pos){
+static uint64_t find_any_startcode(AVIOContext *bc, int64_t pos){
     uint64_t state=0;
 
     if(pos >= 0)
@@ -144,7 +144,7 @@ static uint64_t find_any_startcode(ByteIOContext *bc, int64_t pos){
  * @param pos the start position of the search, or -1 if the current position
  * @return the position of the startcode or -1 if not found
  */
-static int64_t find_startcode(ByteIOContext *bc, uint64_t code, int64_t pos){
+static int64_t find_startcode(AVIOContext *bc, uint64_t code, int64_t pos){
     for(;;){
         uint64_t startcode= find_any_startcode(bc, pos);
         if(startcode == code)
@@ -175,7 +175,7 @@ static int nut_probe(AVProbeData *p){
     }\
     dst= tmp;
 
-static int skip_reserved(ByteIOContext *bc, int64_t pos){
+static int skip_reserved(AVIOContext *bc, int64_t pos){
     pos -= url_ftell(bc);
     if(pos<0){
         url_fseek(bc, pos, SEEK_CUR);
@@ -189,7 +189,7 @@ static int skip_reserved(ByteIOContext *bc, int64_t pos){
 
 static int decode_main_header(NUTContext *nut){
     AVFormatContext *s= nut->avf;
-    ByteIOContext *bc = s->pb;
+    AVIOContext *bc = s->pb;
     uint64_t tmp, end;
     unsigned int stream_count;
     int i, j, tmp_stream, tmp_mul, tmp_pts, tmp_size, count, tmp_res, tmp_head_idx;
@@ -299,7 +299,7 @@ static int decode_main_header(NUTContext *nut){
 
 static int decode_stream_header(NUTContext *nut){
     AVFormatContext *s= nut->avf;
-    ByteIOContext *bc = s->pb;
+    AVIOContext *bc = s->pb;
     StreamContext *stc;
     int class, stream_id;
     uint64_t tmp, end;
@@ -397,7 +397,7 @@ static void set_disposition_bits(AVFormatContext* avf, char* value, int stream_i
 
 static int decode_info_header(NUTContext *nut){
     AVFormatContext *s= nut->avf;
-    ByteIOContext *bc = s->pb;
+    AVIOContext *bc = s->pb;
     uint64_t tmp, chapter_start, chapter_len;
     unsigned int stream_id_plus1, count;
     int chapter_id, i;
@@ -477,7 +477,7 @@ static int decode_info_header(NUTContext *nut){
 
 static int decode_syncpoint(NUTContext *nut, int64_t *ts, int64_t *back_ptr){
     AVFormatContext *s= nut->avf;
-    ByteIOContext *bc = s->pb;
+    AVIOContext *bc = s->pb;
     int64_t end, tmp;
 
     nut->last_syncpoint_pos= url_ftell(bc)-8;
@@ -505,7 +505,7 @@ static int decode_syncpoint(NUTContext *nut, int64_t *ts, int64_t *back_ptr){
 
 static int find_and_decode_index(NUTContext *nut){
     AVFormatContext *s= nut->avf;
-    ByteIOContext *bc = s->pb;
+    AVIOContext *bc = s->pb;
     uint64_t tmp, end;
     int i, j, syncpoint_count;
     int64_t filesize= url_fsize(bc);
@@ -603,7 +603,7 @@ fail:
 static int nut_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     NUTContext *nut = s->priv_data;
-    ByteIOContext *bc = s->pb;
+    AVIOContext *bc = s->pb;
     int64_t pos;
     int initialized_stream_count;
 
@@ -666,7 +666,7 @@ static int nut_read_header(AVFormatContext *s, AVFormatParameters *ap)
 
 static int decode_frame_header(NUTContext *nut, int64_t *pts, int *stream_id, uint8_t *header_idx, int frame_code){
     AVFormatContext *s= nut->avf;
-    ByteIOContext *bc = s->pb;
+    AVIOContext *bc = s->pb;
     StreamContext *stc;
     int size, flags, size_mul, pts_delta, i, reserved_count;
     uint64_t tmp;
@@ -736,7 +736,7 @@ static int decode_frame_header(NUTContext *nut, int64_t *pts, int *stream_id, ui
 
 static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code){
     AVFormatContext *s= nut->avf;
-    ByteIOContext *bc = s->pb;
+    AVIOContext *bc = s->pb;
     int size, stream_id, discard;
     int64_t pts, last_IP_pts;
     StreamContext *stc;
@@ -777,7 +777,7 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code){
 static int nut_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     NUTContext *nut = s->priv_data;
-    ByteIOContext *bc = s->pb;
+    AVIOContext *bc = s->pb;
     int i, frame_code=0, ret, skip;
     int64_t ts, back_ptr;
 
@@ -833,7 +833,7 @@ av_log(s, AV_LOG_DEBUG, "sync\n");
 
 static int64_t nut_read_timestamp(AVFormatContext *s, int stream_index, int64_t *pos_arg, int64_t pos_limit){
     NUTContext *nut = s->priv_data;
-    ByteIOContext *bc = s->pb;
+    AVIOContext *bc = s->pb;
     int64_t pos, pts, back_ptr;
 av_log(s, AV_LOG_DEBUG, "read_timestamp(X,%d,%"PRId64",%"PRId64")\n", stream_index, *pos_arg, pos_limit);
 
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 43d2751..dde0359 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -241,7 +241,7 @@ static void build_frame_code(AVFormatContext *s){
     nut->frame_code['N'].flags= FLAG_INVALID;
 }
 
-static void put_tt(NUTContext *nut, StreamContext *nus, ByteIOContext *bc, uint64_t val){
+static void put_tt(NUTContext *nut, StreamContext *nus, AVIOContext *bc, uint64_t val){
     val *= nut->time_base_count;
     val += nus->time_base - nut->time_base;
     ff_put_v(bc, val);
@@ -250,25 +250,25 @@ static void put_tt(NUTContext *nut, StreamContext *nus, ByteIOContext *bc, uint6
 /**
  * Store a string as vb.
  */
-static void put_str(ByteIOContext *bc, const char *string){
+static void put_str(AVIOContext *bc, const char *string){
     int len= strlen(string);
 
     ff_put_v(bc, len);
     avio_put_buffer(bc, string, len);
 }
 
-static void put_s(ByteIOContext *bc, int64_t val){
+static void put_s(AVIOContext *bc, int64_t val){
     ff_put_v(bc, 2*FFABS(val) - (val>0));
 }
 
 #ifdef TRACE
-static inline void ff_put_v_trace(ByteIOContext *bc, uint64_t v, char *file, char *func, int line){
+static inline void ff_put_v_trace(AVIOContext *bc, uint64_t v, char *file, char *func, int line){
     av_log(NULL, AV_LOG_DEBUG, "ff_put_v %5"PRId64" / %"PRIX64" in %s %s:%d\n", v, v, file, func, line);
 
     ff_put_v(bc, v);
 }
 
-static inline void put_s_trace(ByteIOContext *bc, int64_t v, char *file, char *func, int line){
+static inline void put_s_trace(AVIOContext *bc, int64_t v, char *file, char *func, int line){
     av_log(NULL, AV_LOG_DEBUG, "put_s %5"PRId64" / %"PRIX64" in %s %s:%d\n", v, v, file, func, line);
 
     put_s(bc, v);
@@ -278,7 +278,7 @@ static inline void put_s_trace(ByteIOContext *bc, int64_t v, char *file, char *f
 #endif
 
 //FIXME remove calculate_checksum
-static void put_packet(NUTContext *nut, ByteIOContext *bc, ByteIOContext *dyn_bc, int calculate_checksum, uint64_t startcode){
+static void put_packet(NUTContext *nut, AVIOContext *bc, AVIOContext *dyn_bc, int calculate_checksum, uint64_t startcode){
     uint8_t *dyn_buf=NULL;
     int dyn_size= url_close_dyn_buf(dyn_bc, &dyn_buf);
     int forw_ptr= dyn_size + 4*calculate_checksum;
@@ -299,7 +299,7 @@ static void put_packet(NUTContext *nut, ByteIOContext *bc, ByteIOContext *dyn_bc
     av_free(dyn_buf);
 }
 
-static void write_mainheader(NUTContext *nut, ByteIOContext *bc){
+static void write_mainheader(NUTContext *nut, AVIOContext *bc){
     int i, j, tmp_pts, tmp_flags, tmp_stream, tmp_mul, tmp_size, tmp_fields, tmp_head_idx;
     int64_t tmp_match;
 
@@ -370,7 +370,7 @@ static void write_mainheader(NUTContext *nut, ByteIOContext *bc){
     }
 }
 
-static int write_streamheader(AVFormatContext *avctx, ByteIOContext *bc, AVStream *st, int i){
+static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream *st, int i){
     NUTContext *nut = avctx->priv_data;
     AVCodecContext *codec = st->codec;
     ff_put_v(bc, i);
@@ -422,17 +422,17 @@ static int write_streamheader(AVFormatContext *avctx, ByteIOContext *bc, AVStrea
     return 0;
 }
 
-static int add_info(ByteIOContext *bc, const char *type, const char *value){
+static int add_info(AVIOContext *bc, const char *type, const char *value){
     put_str(bc, type);
     put_s(bc, -1);
     put_str(bc, value);
     return 1;
 }
 
-static int write_globalinfo(NUTContext *nut, ByteIOContext *bc){
+static int write_globalinfo(NUTContext *nut, AVIOContext *bc){
     AVFormatContext *s= nut->avf;
     AVMetadataTag *t = NULL;
-    ByteIOContext *dyn_bc;
+    AVIOContext *dyn_bc;
     uint8_t *dyn_buf=NULL;
     int count=0, dyn_size;
     int ret = url_open_dyn_buf(&dyn_bc);
@@ -455,10 +455,10 @@ static int write_globalinfo(NUTContext *nut, ByteIOContext *bc){
     return 0;
 }
 
-static int write_streaminfo(NUTContext *nut, ByteIOContext *bc, int stream_id){
+static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id){
     AVFormatContext *s= nut->avf;
     AVStream* st = s->streams[stream_id];
-    ByteIOContext *dyn_bc;
+    AVIOContext *dyn_bc;
     uint8_t *dyn_buf=NULL;
     int count=0, dyn_size, i;
     int ret = url_open_dyn_buf(&dyn_bc);
@@ -486,9 +486,9 @@ static int write_streaminfo(NUTContext *nut, ByteIOContext *bc, int stream_id){
     return count;
 }
 
-static int write_headers(AVFormatContext *avctx, ByteIOContext *bc){
+static int write_headers(AVFormatContext *avctx, AVIOContext *bc){
     NUTContext *nut = avctx->priv_data;
-    ByteIOContext *dyn_bc;
+    AVIOContext *dyn_bc;
     int i, ret;
 
     ff_metadata_conv_ctx(avctx, ff_nut_metadata_conv, NULL);
@@ -537,7 +537,7 @@ static int write_headers(AVFormatContext *avctx, ByteIOContext *bc){
 
 static int write_header(AVFormatContext *s){
     NUTContext *nut = s->priv_data;
-    ByteIOContext *bc = s->pb;
+    AVIOContext *bc = s->pb;
     int i, j, ret;
 
     nut->avf= s;
@@ -628,7 +628,7 @@ static int find_best_header_idx(NUTContext *nut, AVPacket *pkt){
 static int write_packet(AVFormatContext *s, AVPacket *pkt){
     NUTContext *nut = s->priv_data;
     StreamContext *nus= &nut->stream[pkt->stream_index];
-    ByteIOContext *bc = s->pb, *dyn_bc;
+    AVIOContext *bc = s->pb, *dyn_bc;
     FrameCode *fc;
     int64_t coded_pts;
     int best_length, frame_code, flags, needed_flags, i, header_idx, best_header_idx;
@@ -781,7 +781,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt){
 
 static int write_trailer(AVFormatContext *s){
     NUTContext *nut= s->priv_data;
-    ByteIOContext *bc= s->pb;
+    AVIOContext *bc= s->pb;
 
     while(nut->header_count<3)
         write_headers(s, bc);
diff --git a/libavformat/nuv.c b/libavformat/nuv.c
index 217367d..4a5fca6 100644
--- a/libavformat/nuv.c
+++ b/libavformat/nuv.c
@@ -55,7 +55,7 @@ static int nuv_probe(AVProbeData *p) {
  * \param myth set if this is a MythTVVideo format file
  * \return 1 if all required codec data was found
  */
-static int get_codec_data(ByteIOContext *pb, AVStream *vst,
+static int get_codec_data(AVIOContext *pb, AVStream *vst,
                           AVStream *ast, int myth) {
     nuv_frametype frametype;
     if (!vst && !myth)
@@ -122,7 +122,7 @@ static int get_codec_data(ByteIOContext *pb, AVStream *vst,
 
 static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) {
     NUVContext *ctx = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     char id_string[12];
     double aspect, fps;
     int is_mythtv, width, height, v_packs, a_packs;
@@ -191,7 +191,7 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) {
 
 static int nuv_packet(AVFormatContext *s, AVPacket *pkt) {
     NUVContext *ctx = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     uint8_t hdr[HDRSIZE];
     nuv_frametype frametype;
     int ret, size;
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index d6b8b92..055abe7 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -84,7 +84,7 @@ static int
 ogg_restore (AVFormatContext * s, int discard)
 {
     struct ogg *ogg = s->priv_data;
-    ByteIOContext *bc = s->pb;
+    AVIOContext *bc = s->pb;
     struct ogg_state *ost = ogg->state;
     int i;
 
@@ -194,7 +194,7 @@ ogg_new_buf(struct ogg *ogg, int idx)
 static int
 ogg_read_page (AVFormatContext * s, int *str)
 {
-    ByteIOContext *bc = s->pb;
+    AVIOContext *bc = s->pb;
     struct ogg *ogg = s->priv_data;
     struct ogg_stream *os;
     int i = 0;
@@ -601,7 +601,7 @@ ogg_read_timestamp (AVFormatContext * s, int stream_index, int64_t * pos_arg,
 {
     struct ogg *ogg = s->priv_data;
     struct ogg_stream *os = ogg->streams + stream_index;
-    ByteIOContext *bc = s->pb;
+    AVIOContext *bc = s->pb;
     int64_t pts = AV_NOPTS_VALUE;
     int i;
     url_fseek(bc, *pos_arg, SEEK_SET);
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 4361876..77c3236 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -64,7 +64,7 @@ typedef struct {
     OGGPageList *page_list;
 } OGGContext;
 
-static void ogg_update_checksum(AVFormatContext *s, ByteIOContext *pb, int64_t crc_offset)
+static void ogg_update_checksum(AVFormatContext *s, AVIOContext *pb, int64_t crc_offset)
 {
     int64_t pos = url_ftell(pb);
     uint32_t checksum = get_checksum(pb);
@@ -76,7 +76,7 @@ static void ogg_update_checksum(AVFormatContext *s, ByteIOContext *pb, int64_t c
 static int ogg_write_page(AVFormatContext *s, OGGPage *page, int extra_flags)
 {
     OGGStreamContext *oggstream = s->streams[page->stream_index]->priv_data;
-    ByteIOContext *pb;
+    AVIOContext *pb;
     int64_t crc_offset;
     int ret, size;
     uint8_t *buf;
diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c
index f306519..1057282 100644
--- a/libavformat/psxstr.c
+++ b/libavformat/psxstr.c
@@ -98,7 +98,7 @@ static int str_probe(AVProbeData *p)
 static int str_read_header(AVFormatContext *s,
                            AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     StrDemuxContext *str = s->priv_data;
     unsigned char sector[RAW_CD_SECTOR_SIZE];
     int start;
@@ -127,7 +127,7 @@ static int str_read_header(AVFormatContext *s,
 static int str_read_packet(AVFormatContext *s,
                            AVPacket *ret_pkt)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     StrDemuxContext *str = s->priv_data;
     unsigned char sector[RAW_CD_SECTOR_SIZE];
     int channel;
diff --git a/libavformat/pva.c b/libavformat/pva.c
index b97d75f..3fcab62 100644
--- a/libavformat/pva.c
+++ b/libavformat/pva.c
@@ -67,7 +67,7 @@ static int pva_read_header(AVFormatContext *s, AVFormatParameters *ap) {
 
 static int read_part_of_packet(AVFormatContext *s, int64_t *pts,
                                int *len, int *strid, int read_packet) {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     PVAContext *pvactx = s->priv_data;
     int syncword, streamid, reserved, flags, length, pts_flag;
     int64_t pva_pts = AV_NOPTS_VALUE, startpos;
@@ -157,7 +157,7 @@ recover:
 }
 
 static int pva_read_packet(AVFormatContext *s, AVPacket *pkt) {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t pva_pts;
     int ret, length, streamid;
 
@@ -173,7 +173,7 @@ static int pva_read_packet(AVFormatContext *s, AVPacket *pkt) {
 
 static int64_t pva_read_timestamp(struct AVFormatContext *s, int stream_index,
                                           int64_t *pos, int64_t pos_limit) {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     PVAContext *pvactx = s->priv_data;
     int length, streamid;
     int64_t res = AV_NOPTS_VALUE;
diff --git a/libavformat/qcp.c b/libavformat/qcp.c
index 1690bb5..b2ccdcf 100644
--- a/libavformat/qcp.c
+++ b/libavformat/qcp.c
@@ -82,7 +82,7 @@ static int qcp_probe(AVProbeData *pd)
 
 static int qcp_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     QCPContext    *c  = s->priv_data;
     AVStream      *st = av_new_stream(s, 0);
     uint8_t       buf[16];
@@ -136,7 +136,7 @@ static int qcp_read_header(AVFormatContext *s, AVFormatParameters *ap)
 
 static int qcp_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     QCPContext    *c  = s->priv_data;
     unsigned int  chunk_size, tag;
 
diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index ac835fd..964506b 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -130,7 +130,7 @@ ff_rdt_calc_response_and_checksum(char response[41], char chksum[9],
 static int
 rdt_load_mdpr (PayloadContext *rdt, AVStream *st, int rule_nr)
 {
-    ByteIOContext pb;
+    AVIOContext pb;
     int size;
     uint32_t tag;
 
@@ -295,7 +295,7 @@ rdt_parse_packet (AVFormatContext *ctx, PayloadContext *rdt, AVStream *st,
                   const uint8_t *buf, int len, int flags)
 {
     int seq = 1, res;
-    ByteIOContext pb;
+    AVIOContext pb;
 
     if (rdt->audio_pkt_cnt == 0) {
         int pos;
diff --git a/libavformat/riff.c b/libavformat/riff.c
index 7d720c7..1d785af 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -319,14 +319,14 @@ const AVCodecTag ff_codec_wav_tags[] = {
 };
 
 #if CONFIG_MUXERS
-int64_t ff_start_tag(ByteIOContext *pb, const char *tag)
+int64_t ff_start_tag(AVIOContext *pb, const char *tag)
 {
     avio_put_tag(pb, tag);
     avio_put_le32(pb, 0);
     return url_ftell(pb);
 }
 
-void ff_end_tag(ByteIOContext *pb, int64_t start)
+void ff_end_tag(AVIOContext *pb, int64_t start)
 {
     int64_t pos;
 
@@ -338,7 +338,7 @@ void ff_end_tag(ByteIOContext *pb, int64_t start)
 
 /* WAVEFORMATEX header */
 /* returns the size or -1 on error */
-int ff_put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
+int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
 {
     int bps, blkalign, bytespersec;
     int hdrsize = 18;
@@ -445,7 +445,7 @@ int ff_put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
 }
 
 /* BITMAPINFOHEADER header */
-void ff_put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf)
+void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf)
 {
     avio_put_le32(pb, 40 + enc->extradata_size); /* size */
     avio_put_le32(pb, enc->width);
@@ -477,7 +477,7 @@ void ff_put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const AVCodecTag
  * WAVEFORMATEX adds 'WORD  cbSize' and basically makes itself
  * an openended structure.
  */
-void ff_get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size)
+void ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
 {
     int id;
 
@@ -544,7 +544,7 @@ enum CodecID ff_wav_codec_get_id(unsigned int tag, int bps)
     return id;
 }
 
-int ff_get_bmp_header(ByteIOContext *pb, AVStream *st)
+int ff_get_bmp_header(AVIOContext *pb, AVStream *st)
 {
     int tag1;
     avio_get_le32(pb); /* size */
diff --git a/libavformat/riff.h b/libavformat/riff.h
index 5045abc..5a45a38 100644
--- a/libavformat/riff.h
+++ b/libavformat/riff.h
@@ -32,20 +32,20 @@
 #include "avio.h"
 #include "internal.h"
 
-int64_t ff_start_tag(ByteIOContext *pb, const char *tag);
-void ff_end_tag(ByteIOContext *pb, int64_t start);
+int64_t ff_start_tag(AVIOContext *pb, const char *tag);
+void ff_end_tag(AVIOContext *pb, int64_t start);
 
 /**
  * Read BITMAPINFOHEADER structure and set AVStream codec width, height and
  * bits_per_encoded_sample fields. Does not read extradata.
  * @return codec tag
  */
-int ff_get_bmp_header(ByteIOContext *pb, AVStream *st);
+int ff_get_bmp_header(AVIOContext *pb, AVStream *st);
 
-void ff_put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf);
-int ff_put_wav_header(ByteIOContext *pb, AVCodecContext *enc);
+void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf);
+int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc);
 enum CodecID ff_wav_codec_get_id(unsigned int tag, int bps);
-void ff_get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size);
+void ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size);
 
 extern const AVCodecTag ff_codec_bmp_tags[];
 extern const AVCodecTag ff_codec_wav_tags[];
diff --git a/libavformat/rl2.c b/libavformat/rl2.c
index 14f8f19..7748fbc 100644
--- a/libavformat/rl2.c
+++ b/libavformat/rl2.c
@@ -74,7 +74,7 @@ static int rl2_probe(AVProbeData *p)
 static av_cold int rl2_read_header(AVFormatContext *s,
                             AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     unsigned int frame_count;
     unsigned int audio_frame_counter = 0;
@@ -214,7 +214,7 @@ static int rl2_read_packet(AVFormatContext *s,
                             AVPacket *pkt)
 {
     Rl2DemuxContext *rl2 = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVIndexEntry *sample = NULL;
     int i;
     int ret = 0;
diff --git a/libavformat/rm.h b/libavformat/rm.h
index 2d4656a..6de1092 100644
--- a/libavformat/rm.h
+++ b/libavformat/rm.h
@@ -41,7 +41,7 @@ extern AVInputFormat ff_rdt_demuxer;
  * Read the MDPR chunk, which contains stream-specific codec initialization
  * parameters.
  *
- * @param s context containing RMContext and ByteIOContext for stream reading
+ * @param s context containing RMContext and AVIOContext for stream reading
  * @param pb context to read the data from
  * @param st the stream that the MDPR chunk belongs to and where to store the
  *           parameters read from the chunk into
@@ -49,14 +49,14 @@ extern AVInputFormat ff_rdt_demuxer;
  * @param codec_data_size size of the MDPR chunk
  * @return 0 on success, errno codes on error
  */
-int ff_rm_read_mdpr_codecdata (AVFormatContext *s, ByteIOContext *pb,
+int ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
                                AVStream *st, RMStream *rst,
                                int codec_data_size);
 
 /**
  * Parse one rm-stream packet from the input bytestream.
  *
- * @param s context containing RMContext and ByteIOContext for stream reading
+ * @param s context containing RMContext and AVIOContext for stream reading
  * @param pb context to read the data from
  * @param st stream to which the packet to be read belongs
  * @param rst Real-specific stream information
@@ -70,7 +70,7 @@ int ff_rm_read_mdpr_codecdata (AVFormatContext *s, ByteIOContext *pb,
  *         value >0 means that no data was placed in pkt, but that cached
  *         data is available by calling ff_rm_retrieve_cache().
  */
-int ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb,
+int ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
                         AVStream *st, RMStream *rst, int len,
                         AVPacket *pkt, int *seq, int flags, int64_t ts);
 
@@ -82,7 +82,7 @@ int ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb,
  * a positive number, the amount of cached packets. Using this function, each
  * of those packets can be retrieved sequentially.
  *
- * @param s context containing RMContext and ByteIOContext for stream reading
+ * @param s context containing RMContext and AVIOContext for stream reading
  * @param pb context to read the data from
  * @param st stream that this packet belongs to
  * @param rst Real-specific stream information
@@ -90,7 +90,7 @@ int ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb,
  * @return the number of samples left for subsequent calls to this same
  *          function, or 0 if all samples have been retrieved.
  */
-int ff_rm_retrieve_cache (AVFormatContext *s, ByteIOContext *pb,
+int ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
                           AVStream *st, RMStream *rst, AVPacket *pkt);
 
 /**
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 1f5a171..2dcf0e9 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -64,7 +64,7 @@ static const unsigned char sipr_swaps[38][2] = {
 
 const unsigned char ff_sipr_subpk_size[4] = { 29, 19, 37, 20 };
 
-static inline void get_strl(ByteIOContext *pb, char *buf, int buf_size, int len)
+static inline void get_strl(AVIOContext *pb, char *buf, int buf_size, int len)
 {
     int i;
     char *q, r;
@@ -78,12 +78,12 @@ static inline void get_strl(ByteIOContext *pb, char *buf, int buf_size, int len)
     if (buf_size > 0) *q = '\0';
 }
 
-static void get_str8(ByteIOContext *pb, char *buf, int buf_size)
+static void get_str8(AVIOContext *pb, char *buf, int buf_size)
 {
     get_strl(pb, buf, buf_size, avio_get_byte(pb));
 }
 
-static int rm_read_extradata(ByteIOContext *pb, AVCodecContext *avctx, unsigned size)
+static int rm_read_extradata(AVIOContext *pb, AVCodecContext *avctx, unsigned size)
 {
     if (size >= 1<<24)
         return -1;
@@ -120,7 +120,7 @@ void ff_rm_free_rmstream (RMStream *rms)
     av_free_packet(&rms->pkt);
 }
 
-static int rm_read_audio_stream_info(AVFormatContext *s, ByteIOContext *pb,
+static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
                                      AVStream *st, RMStream *ast, int read_all)
 {
     char buf[256];
@@ -264,7 +264,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, ByteIOContext *pb,
 }
 
 int
-ff_rm_read_mdpr_codecdata (AVFormatContext *s, ByteIOContext *pb,
+ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
                            AVStream *st, RMStream *rst, int codec_data_size)
 {
     unsigned int v;
@@ -330,7 +330,7 @@ skip:
  * of the INDX chunk, and will bail out if not. */
 static int rm_read_index(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned int size, n_pkts, str_id, next_off, n, pos, pts;
     AVStream *st;
 
@@ -387,7 +387,7 @@ static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     RMDemuxContext *rm = s->priv_data;
     AVStream *st;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned int tag;
     int tag_size;
     unsigned int start_time, duration;
@@ -490,7 +490,7 @@ static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap)
     return 0;
 }
 
-static int get_num(ByteIOContext *pb, int *len)
+static int get_num(AVIOContext *pb, int *len)
 {
     int n, n1;
 
@@ -511,7 +511,7 @@ static int get_num(ByteIOContext *pb, int *len)
 
 static int sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_index, int64_t *pos){
     RMDemuxContext *rm = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     uint32_t state=0xFFFFFFFF;
 
@@ -577,7 +577,7 @@ skip:
     return -1;
 }
 
-static int rm_assemble_video_frame(AVFormatContext *s, ByteIOContext *pb,
+static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
                                    RMDemuxContext *rm, RMStream *vst,
                                    AVPacket *pkt, int len, int *pseq)
 {
@@ -700,7 +700,7 @@ void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize)
 }
 
 int
-ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb,
+ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
                     AVStream *st, RMStream *ast, int len, AVPacket *pkt,
                     int *seq, int flags, int64_t timestamp)
 {
@@ -791,7 +791,7 @@ ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb,
 }
 
 int
-ff_rm_retrieve_cache (AVFormatContext *s, ByteIOContext *pb,
+ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
                       AVStream *st, RMStream *ast, AVPacket *pkt)
 {
     RMDemuxContext *rm = s->priv_data;
diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c
index 22755f8..a5452b3 100644
--- a/libavformat/rmenc.c
+++ b/libavformat/rmenc.c
@@ -44,7 +44,7 @@ typedef struct {
 #define BUFFER_DURATION 0
 
 
-static void put_str(ByteIOContext *s, const char *tag)
+static void put_str(AVIOContext *s, const char *tag)
 {
     avio_put_be16(s,strlen(tag));
     while (*tag) {
@@ -52,7 +52,7 @@ static void put_str(ByteIOContext *s, const char *tag)
     }
 }
 
-static void put_str8(ByteIOContext *s, const char *tag)
+static void put_str8(AVIOContext *s, const char *tag)
 {
     avio_put_byte(s, strlen(tag));
     while (*tag) {
@@ -64,7 +64,7 @@ static int rv10_write_header(AVFormatContext *ctx,
                              int data_size, int index_pos)
 {
     RMMuxContext *rm = ctx->priv_data;
-    ByteIOContext *s = ctx->pb;
+    AVIOContext *s = ctx->pb;
     StreamInfo *stream;
     unsigned char *data_offset_ptr, *start_ptr;
     const char *desc, *mimetype;
@@ -283,7 +283,7 @@ static void write_packet_header(AVFormatContext *ctx, StreamInfo *stream,
                                 int length, int key_frame)
 {
     int timestamp;
-    ByteIOContext *s = ctx->pb;
+    AVIOContext *s = ctx->pb;
 
     stream->nb_packets++;
     stream->packet_total_size += length;
@@ -347,7 +347,7 @@ static int rm_write_audio(AVFormatContext *s, const uint8_t *buf, int size, int
 {
     uint8_t *buf1;
     RMMuxContext *rm = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     StreamInfo *stream = rm->audio_stream;
     int i;
 
@@ -375,7 +375,7 @@ static int rm_write_audio(AVFormatContext *s, const uint8_t *buf, int size, int
 static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size, int flags)
 {
     RMMuxContext *rm = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     StreamInfo *stream = rm->video_stream;
     int key_frame = !!(flags & AV_PKT_FLAG_KEY);
 
@@ -430,7 +430,7 @@ static int rm_write_trailer(AVFormatContext *s)
 {
     RMMuxContext *rm = s->priv_data;
     int data_size, index_pos, i;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     if (!url_is_streamed(s->pb)) {
         /* end of file: finish to write header */
diff --git a/libavformat/rpl.c b/libavformat/rpl.c
index f32a439..8c836dd 100644
--- a/libavformat/rpl.c
+++ b/libavformat/rpl.c
@@ -47,7 +47,7 @@ typedef struct RPLContext {
     uint32_t frame_in_part;
 } RPLContext;
 
-static int read_line(ByteIOContext * pb, char* line, int bufsize)
+static int read_line(AVIOContext * pb, char* line, int bufsize)
 {
     int i;
     for (i = 0; i < bufsize - 1; i++) {
@@ -76,7 +76,7 @@ static int32_t read_int(const char* line, const char** endptr, int* error)
     return result;
 }
 
-static int32_t read_line_and_int(ByteIOContext * pb, int* error)
+static int32_t read_line_and_int(AVIOContext * pb, int* error)
 {
     char line[RPL_LINE_LENGTH];
     const char *endptr;
@@ -110,7 +110,7 @@ static AVRational read_fps(const char* line, int* error)
 
 static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     RPLContext *rpl = s->priv_data;
     AVStream *vst = NULL, *ast = NULL;
     int total_audio_size;
@@ -274,7 +274,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap)
 static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     RPLContext *rpl = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream* stream;
     AVIndexEntry* index_entry;
     uint32_t ret;
diff --git a/libavformat/rsodec.c b/libavformat/rsodec.c
index 743d0a0..2effae8 100644
--- a/libavformat/rsodec.c
+++ b/libavformat/rsodec.c
@@ -29,7 +29,7 @@
 
 static int rso_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int id, rate, bps;
     unsigned int size;
     enum CodecID codec;
diff --git a/libavformat/rsoenc.c b/libavformat/rsoenc.c
index b349b3c..6e2e953 100644
--- a/libavformat/rsoenc.c
+++ b/libavformat/rsoenc.c
@@ -27,7 +27,7 @@
 
 static int rso_write_header(AVFormatContext *s)
 {
-    ByteIOContext  *pb  = s->pb;
+    AVIOContext  *pb  = s->pb;
     AVCodecContext *enc = s->streams[0]->codec;
 
     if (!enc->codec_tag)
@@ -73,7 +73,7 @@ static int rso_write_packet(AVFormatContext *s, AVPacket *pkt)
 
 static int rso_write_trailer(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t file_size;
     uint16_t coded_file_size;
 
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 264b3f9..f2b84dd 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -237,7 +237,7 @@ static void rtcp_update_jitter(RTPStatistics *s, uint32_t sent_timestamp, uint32
 
 int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
 {
-    ByteIOContext *pb;
+    AVIOContext *pb;
     uint8_t *buf;
     int len;
     int rtcp_bytes;
@@ -334,7 +334,7 @@ int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
 
 void rtp_send_punch_packets(URLContext* rtp_handle)
 {
-    ByteIOContext *pb;
+    AVIOContext *pb;
     uint8_t *buf;
     int len;
 
diff --git a/libavformat/rtpdec_asf.c b/libavformat/rtpdec_asf.c
index 75b2d87..f6f4887 100644
--- a/libavformat/rtpdec_asf.c
+++ b/libavformat/rtpdec_asf.c
@@ -72,7 +72,7 @@ static int rtp_asf_fix_header(uint8_t *buf, int len)
 }
 
 /**
- * The following code is basically a buffered ByteIOContext,
+ * The following code is basically a buffered AVIOContext,
  * with the added benefit of returning -EAGAIN (instead of 0)
  * on packet boundaries, such that the ASF demuxer can return
  * safely and resume business at the next packet.
@@ -82,7 +82,7 @@ static int packetizer_read(void *opaque, uint8_t *buf, int buf_size)
     return AVERROR(EAGAIN);
 }
 
-static void init_packetizer(ByteIOContext *pb, uint8_t *buf, int len)
+static void init_packetizer(AVIOContext *pb, uint8_t *buf, int len)
 {
     init_put_byte(pb, buf, len, 0, NULL, packetizer_read, NULL, NULL);
 
@@ -95,7 +95,7 @@ int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
 {
     int ret = 0;
     if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {
-        ByteIOContext pb;
+        AVIOContext pb;
         RTSPState *rt = s->priv_data;
         int len = strlen(p) * 6 / 8;
         char *buf = av_mallocz(len);
@@ -147,7 +147,7 @@ static int asfrtp_parse_sdp_line(AVFormatContext *s, int stream_index,
 }
 
 struct PayloadContext {
-    ByteIOContext *pktbuf, pb;
+    AVIOContext *pktbuf, pb;
     uint8_t *buf;
 };
 
@@ -161,7 +161,7 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf,
                                uint32_t *timestamp,
                                const uint8_t *buf, int len, int flags)
 {
-    ByteIOContext *pb = &asf->pb;
+    AVIOContext *pb = &asf->pb;
     int res, mflags, len_off;
     RTSPState *rt = s->priv_data;
 
diff --git a/libavformat/rtpdec_latm.c b/libavformat/rtpdec_latm.c
index aa0c9e3..0be6aea 100644
--- a/libavformat/rtpdec_latm.c
+++ b/libavformat/rtpdec_latm.c
@@ -26,7 +26,7 @@
 #include <strings.h>
 
 struct PayloadContext {
-    ByteIOContext *dyn_buf;
+    AVIOContext *dyn_buf;
     uint8_t *buf;
     int pos, len;
     uint32_t timestamp;
diff --git a/libavformat/rtpdec_qt.c b/libavformat/rtpdec_qt.c
index 91b98f1..dbed3bb 100644
--- a/libavformat/rtpdec_qt.c
+++ b/libavformat/rtpdec_qt.c
@@ -42,7 +42,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
                                uint32_t *timestamp, const uint8_t *buf,
                                int len, int flags)
 {
-    ByteIOContext pb;
+    AVIOContext pb;
     GetBitContext gb;
     int packing_scheme, has_payload_desc, has_packet_info, alen,
         has_marker_bit = flags & RTP_FLAG_MARKER;
diff --git a/libavformat/rtpdec_svq3.c b/libavformat/rtpdec_svq3.c
index 59a1d71..d06e3f0 100644
--- a/libavformat/rtpdec_svq3.c
+++ b/libavformat/rtpdec_svq3.c
@@ -33,7 +33,7 @@
 #include "rtpdec_formats.h"
 
 struct PayloadContext {
-    ByteIOContext *pktbuf;
+    AVIOContext *pktbuf;
     int64_t        timestamp;
 };
 
diff --git a/libavformat/rtpdec_vp8.c b/libavformat/rtpdec_vp8.c
index 888186c..47199ae 100644
--- a/libavformat/rtpdec_vp8.c
+++ b/libavformat/rtpdec_vp8.c
@@ -31,7 +31,7 @@
 #include "rtpdec_formats.h"
 
 struct PayloadContext {
-    ByteIOContext *data;
+    AVIOContext *data;
     uint32_t       timestamp;
     int is_keyframe;
 };
diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c
index f417cb3..51d7d6b 100644
--- a/libavformat/rtpdec_xiph.c
+++ b/libavformat/rtpdec_xiph.c
@@ -42,7 +42,7 @@
 struct PayloadContext {
     unsigned ident;             ///< 24-bit stream configuration identifier
     uint32_t timestamp;
-    ByteIOContext* fragment;    ///< buffer for split payloads
+    AVIOContext* fragment;    ///< buffer for split payloads
     uint8_t *split_buf;
     int split_pos, split_buf_len, split_buf_size;
     int split_pkts;
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 2b89a8b..8547d14 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1855,7 +1855,7 @@ static int rtp_read_header(AVFormatContext *s,
     int payload_type;
     AVCodecContext codec;
     struct sockaddr_storage addr;
-    ByteIOContext pb;
+    AVIOContext pb;
     socklen_t addrlen = sizeof(addr);
 
     if (!ff_network_init())
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index 14d3f41..0fec3cc 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -193,7 +193,7 @@ enum RTSPServerType {
 /**
  * Private data for the RTSP demuxer.
  *
- * @todo Use ByteIOContext instead of URLContext
+ * @todo Use AVIOContext instead of URLContext
  */
 typedef struct RTSPState {
     URLContext *rtsp_hd; /* RTSP TCP connection handle */
@@ -218,7 +218,7 @@ typedef struct RTSPState {
     int64_t seek_timestamp;
 
     /* XXX: currently we use unbuffered input */
-    //    ByteIOContext rtsp_gb;
+    //    AVIOContext rtsp_gb;
 
     int seq;                          /**< RTSP command sequence number */
 
diff --git a/libavformat/sapdec.c b/libavformat/sapdec.c
index 73525f5..ef1ecc4 100644
--- a/libavformat/sapdec.c
+++ b/libavformat/sapdec.c
@@ -33,7 +33,7 @@
 struct SAPState {
     URLContext *ann_fd;
     AVFormatContext *sdp_ctx;
-    ByteIOContext sdp_pb;
+    AVIOContext sdp_pb;
     uint16_t hash;
     char *sdp;
     int eof;
diff --git a/libavformat/sauce.c b/libavformat/sauce.c
index e95773d..b121e39 100644
--- a/libavformat/sauce.c
+++ b/libavformat/sauce.c
@@ -30,7 +30,7 @@
 
 int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int get_height)
 {
-    ByteIOContext *pb = avctx->pb;
+    AVIOContext *pb = avctx->pb;
     char buf[36];
     int datatype, filetype, t1, t2, nb_comments, flags;
     uint64_t start_pos = url_fsize(pb) - 128;
diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c
index d30fa99..70bab71 100644
--- a/libavformat/segafilm.c
+++ b/libavformat/segafilm.c
@@ -77,7 +77,7 @@ static int film_read_header(AVFormatContext *s,
                             AVFormatParameters *ap)
 {
     FilmDemuxContext *film = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     unsigned char scratch[256];
     int i;
@@ -205,7 +205,7 @@ static int film_read_packet(AVFormatContext *s,
                             AVPacket *pkt)
 {
     FilmDemuxContext *film = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     film_sample *sample;
     int ret = 0;
     int i;
diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c
index c00524f..2857654 100644
--- a/libavformat/sierravmd.c
+++ b/libavformat/sierravmd.c
@@ -81,7 +81,7 @@ static int vmd_read_header(AVFormatContext *s,
                            AVFormatParameters *ap)
 {
     VmdDemuxContext *vmd = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st = NULL, *vst;
     unsigned int toc_offset;
     unsigned char *raw_frame_table;
@@ -234,7 +234,7 @@ static int vmd_read_packet(AVFormatContext *s,
                            AVPacket *pkt)
 {
     VmdDemuxContext *vmd = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int ret = 0;
     vmd_frame *frame;
 
diff --git a/libavformat/siff.c b/libavformat/siff.c
index 013aa73..2a9a651 100644
--- a/libavformat/siff.c
+++ b/libavformat/siff.c
@@ -84,7 +84,7 @@ static int create_audio_stream(AVFormatContext *s, SIFFContext *c)
     return 0;
 }
 
-static int siff_parse_vbv1(AVFormatContext *s, SIFFContext *c, ByteIOContext *pb)
+static int siff_parse_vbv1(AVFormatContext *s, SIFFContext *c, AVIOContext *pb)
 {
     AVStream *st;
     int width, height;
@@ -135,7 +135,7 @@ static int siff_parse_vbv1(AVFormatContext *s, SIFFContext *c, ByteIOContext *pb
     return 0;
 }
 
-static int siff_parse_soun(AVFormatContext *s, SIFFContext *c, ByteIOContext *pb)
+static int siff_parse_soun(AVFormatContext *s, SIFFContext *c, AVIOContext *pb)
 {
     if (avio_get_le32(pb) != TAG_SHDR){
         av_log(s, AV_LOG_ERROR, "Header chunk is missing\n");
@@ -154,7 +154,7 @@ static int siff_parse_soun(AVFormatContext *s, SIFFContext *c, ByteIOContext *pb
 
 static int siff_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     SIFFContext *c = s->priv_data;
     uint32_t tag;
 
diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 790702f..12ce80f 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -98,7 +98,7 @@ static int smacker_probe(AVProbeData *p)
 
 static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     SmackerContext *smk = s->priv_data;
     AVStream *st, *ast[7];
     int i, ret;
diff --git a/libavformat/sol.c b/libavformat/sol.c
index 9dec54a..fb42ddc 100644
--- a/libavformat/sol.c
+++ b/libavformat/sol.c
@@ -87,7 +87,7 @@ static int sol_read_header(AVFormatContext *s,
 {
     int size;
     unsigned int magic,tag;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned int id, channels, rate, type;
     enum CodecID codec;
     AVStream *st;
diff --git a/libavformat/soxdec.c b/libavformat/soxdec.c
index 3a30683..3e3f01d 100644
--- a/libavformat/soxdec.c
+++ b/libavformat/soxdec.c
@@ -44,7 +44,7 @@ static int sox_probe(AVProbeData *p)
 static int sox_read_header(AVFormatContext *s,
                            AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned header_size, comment_size;
     double sample_rate, sample_rate_frac;
     AVStream *st;
diff --git a/libavformat/soxenc.c b/libavformat/soxenc.c
index 5142f46..c17e456 100644
--- a/libavformat/soxenc.c
+++ b/libavformat/soxenc.c
@@ -40,7 +40,7 @@ typedef struct {
 static int sox_write_header(AVFormatContext *s)
 {
     SoXContext *sox = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVCodecContext *enc = s->streams[0]->codec;
     AVMetadataTag *comment;
     size_t comment_len = 0, comment_size;
@@ -84,7 +84,7 @@ static int sox_write_header(AVFormatContext *s)
 
 static int sox_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     avio_put_buffer(pb, pkt->data, pkt->size);
     return 0;
 }
@@ -92,7 +92,7 @@ static int sox_write_packet(AVFormatContext *s, AVPacket *pkt)
 static int sox_write_trailer(AVFormatContext *s)
 {
     SoXContext *sox = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVCodecContext *enc = s->streams[0]->codec;
 
     if (!url_is_streamed(s->pb)) {
diff --git a/libavformat/spdifdec.c b/libavformat/spdifdec.c
index 07b085c..eb26bcb 100644
--- a/libavformat/spdifdec.c
+++ b/libavformat/spdifdec.c
@@ -163,7 +163,7 @@ static int spdif_read_header(AVFormatContext *s, AVFormatParameters *ap)
 
 static int spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     enum IEC61937DataType data_type;
     enum CodecID codec_id;
     uint32_t state = 0;
diff --git a/libavformat/spdifenc.c b/libavformat/spdifenc.c
index a27e7b4..b96e58d 100644
--- a/libavformat/spdifenc.c
+++ b/libavformat/spdifenc.c
@@ -473,7 +473,7 @@ static int spdif_write_trailer(AVFormatContext *s)
 }
 
 static av_always_inline void spdif_put_16(IEC61937Context *ctx,
-                                          ByteIOContext *pb, unsigned int val)
+                                          AVIOContext *pb, unsigned int val)
 {
     if (ctx->spdif_flags & SPDIF_FLAG_BIGENDIAN)
         avio_put_be16(pb, val);
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index cfdcede..aef0118 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -23,7 +23,7 @@
 #include "libavutil/intreadwrite.h"
 #include "swf.h"
 
-static int get_swf_tag(ByteIOContext *pb, int *len_ptr)
+static int get_swf_tag(AVIOContext *pb, int *len_ptr)
 {
     int tag, len;
 
@@ -55,7 +55,7 @@ static int swf_probe(AVProbeData *p)
 static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     SWFContext *swf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int nbits, len, tag;
 
     tag = avio_get_be32(pb) & 0xffffff00;
@@ -82,7 +82,7 @@ static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap)
 static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     SWFContext *swf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *vst = NULL, *ast = NULL, *st = 0;
     int tag, len, i, frame, v;
 
diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c
index 0acd2cb..c685491 100644
--- a/libavformat/swfenc.c
+++ b/libavformat/swfenc.c
@@ -27,7 +27,7 @@
 static void put_swf_tag(AVFormatContext *s, int tag)
 {
     SWFContext *swf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     swf->tag_pos = url_ftell(pb);
     swf->tag = tag;
@@ -43,7 +43,7 @@ static void put_swf_tag(AVFormatContext *s, int tag)
 static void put_swf_end_tag(AVFormatContext *s)
 {
     SWFContext *swf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t pos;
     int tag_len, tag;
 
@@ -78,7 +78,7 @@ static inline void max_nbits(int *nbits_ptr, int val)
         *nbits_ptr = n;
 }
 
-static void put_swf_rect(ByteIOContext *pb,
+static void put_swf_rect(AVIOContext *pb,
                          int xmin, int xmax, int ymin, int ymax)
 {
     PutBitContext p;
@@ -134,7 +134,7 @@ static void put_swf_line_edge(PutBitContext *pb, int dx, int dy)
 
 #define FRAC_BITS 16
 
-static void put_swf_matrix(ByteIOContext *pb,
+static void put_swf_matrix(AVIOContext *pb,
                            int a, int b, int c, int d, int tx, int ty)
 {
     PutBitContext p;
@@ -173,7 +173,7 @@ static void put_swf_matrix(ByteIOContext *pb,
 static int swf_write_header(AVFormatContext *s)
 {
     SWFContext *swf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     PutBitContext p;
     uint8_t buf1[256];
     int i, width, height, rate, rate_base;
@@ -334,7 +334,7 @@ static int swf_write_video(AVFormatContext *s,
                            AVCodecContext *enc, const uint8_t *buf, int size)
 {
     SWFContext *swf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     /* Flash Player limit */
     if (swf->swf_frame_number == 16000)
@@ -473,7 +473,7 @@ static int swf_write_packet(AVFormatContext *s, AVPacket *pkt)
 static int swf_write_trailer(AVFormatContext *s)
 {
     SWFContext *swf = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVCodecContext *enc, *video_enc;
     int file_size, i;
 
diff --git a/libavformat/thp.c b/libavformat/thp.c
index bd14486..2a1981d 100644
--- a/libavformat/thp.c
+++ b/libavformat/thp.c
@@ -57,7 +57,7 @@ static int thp_read_header(AVFormatContext *s,
 {
     ThpDemuxContext *thp = s->priv_data;
     AVStream *st;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int i;
 
     /* Read the file header.  */
@@ -140,7 +140,7 @@ static int thp_read_packet(AVFormatContext *s,
                             AVPacket *pkt)
 {
     ThpDemuxContext *thp = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int size;
     int ret;
 
diff --git a/libavformat/tiertexseq.c b/libavformat/tiertexseq.c
index c06eccd..132f974 100644
--- a/libavformat/tiertexseq.c
+++ b/libavformat/tiertexseq.c
@@ -78,7 +78,7 @@ static int seq_probe(AVProbeData *p)
     return AVPROBE_SCORE_MAX / 4;
 }
 
-static int seq_init_frame_buffers(SeqDemuxContext *seq, ByteIOContext *pb)
+static int seq_init_frame_buffers(SeqDemuxContext *seq, AVIOContext *pb)
 {
     int i, sz;
     TiertexSeqFrameBuffer *seq_buffer;
@@ -102,7 +102,7 @@ static int seq_init_frame_buffers(SeqDemuxContext *seq, ByteIOContext *pb)
     return 0;
 }
 
-static int seq_fill_buffer(SeqDemuxContext *seq, ByteIOContext *pb, int buffer_num, unsigned int data_offs, int data_size)
+static int seq_fill_buffer(SeqDemuxContext *seq, AVIOContext *pb, int buffer_num, unsigned int data_offs, int data_size)
 {
     TiertexSeqFrameBuffer *seq_buffer;
 
@@ -121,7 +121,7 @@ static int seq_fill_buffer(SeqDemuxContext *seq, ByteIOContext *pb, int buffer_n
     return 0;
 }
 
-static int seq_parse_frame_data(SeqDemuxContext *seq, ByteIOContext *pb)
+static int seq_parse_frame_data(SeqDemuxContext *seq, AVIOContext *pb)
 {
     unsigned int offset_table[4], buffer_num[4];
     TiertexSeqFrameBuffer *seq_buffer;
@@ -184,7 +184,7 @@ static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     int i, rc;
     SeqDemuxContext *seq = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
 
     /* init internal buffers */
@@ -241,7 +241,7 @@ static int seq_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     int rc;
     SeqDemuxContext *seq = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     if (!seq->audio_buffer_full) {
         rc = seq_parse_frame_data(seq, pb);
diff --git a/libavformat/tmv.c b/libavformat/tmv.c
index efb8d88..dece429 100644
--- a/libavformat/tmv.c
+++ b/libavformat/tmv.c
@@ -65,7 +65,7 @@ static int tmv_probe(AVProbeData *p)
 static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     TMVContext *tmv   = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *vst, *ast;
     AVRational fps;
     unsigned comp_method, char_cols, char_rows, features;
@@ -142,7 +142,7 @@ static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap)
 static int tmv_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     TMVContext *tmv   = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int ret, pkt_size = tmv->stream_index ?
                         tmv->audio_chunk_size : tmv->video_chunk_size;
 
diff --git a/libavformat/tty.c b/libavformat/tty.c
index c559a6c..5b8b8af 100644
--- a/libavformat/tty.c
+++ b/libavformat/tty.c
@@ -42,7 +42,7 @@ typedef struct {
 static int efi_read(AVFormatContext *avctx, uint64_t start_pos)
 {
     TtyDemuxContext *s = avctx->priv_data;
-    ByteIOContext *pb = avctx->pb;
+    AVIOContext *pb = avctx->pb;
     char buf[37];
     int len;
 
diff --git a/libavformat/txd.c b/libavformat/txd.c
index adc975b..6dbfb4d 100644
--- a/libavformat/txd.c
+++ b/libavformat/txd.c
@@ -52,7 +52,7 @@ static int txd_read_header(AVFormatContext *s, AVFormatParameters *ap) {
 }
 
 static int txd_read_packet(AVFormatContext *s, AVPacket *pkt) {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned int id, chunk_size, marker;
     int ret;
 
diff --git a/libavformat/utils.c b/libavformat/utils.c
index b2628a3..d13fb50 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -323,7 +323,7 @@ FF_SYMVER(void, av_init_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
 }
 #endif
 
-int av_get_packet(ByteIOContext *s, AVPacket *pkt, int size)
+int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)
 {
     int ret= av_new_packet(pkt, size);
 
@@ -341,7 +341,7 @@ int av_get_packet(ByteIOContext *s, AVPacket *pkt, int size)
     return ret;
 }
 
-int av_append_packet(ByteIOContext *s, AVPacket *pkt, int size)
+int av_append_packet(AVIOContext *s, AVPacket *pkt, int size)
 {
     int ret;
     int old_size;
@@ -442,7 +442,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, AVProbeDa
  * Open a media file from an IO stream. 'fmt' must be specified.
  */
 int av_open_input_stream(AVFormatContext **ic_ptr,
-                         ByteIOContext *pb, const char *filename,
+                         AVIOContext *pb, const char *filename,
                          AVInputFormat *fmt, AVFormatParameters *ap)
 {
     int err;
@@ -479,7 +479,7 @@ int av_open_input_stream(AVFormatContext **ic_ptr,
         ic->priv_data = NULL;
     }
 
-    // e.g. AVFMT_NOFILE formats will not have a ByteIOContext
+    // e.g. AVFMT_NOFILE formats will not have a AVIOContext
     if (ic->pb)
         ff_id3v2_read(ic, ID3v2_DEFAULT_MAGIC);
 
@@ -524,7 +524,7 @@ int av_open_input_stream(AVFormatContext **ic_ptr,
 #define PROBE_BUF_MIN 2048
 #define PROBE_BUF_MAX (1<<20)
 
-int av_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt,
+int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
                           const char *filename, void *logctx,
                           unsigned int offset, unsigned int max_probe_size)
 {
@@ -598,7 +598,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
 {
     int err;
     AVProbeData probe_data, *pd = &probe_data;
-    ByteIOContext *pb = NULL;
+    AVIOContext *pb = NULL;
     void *logctx= ap && ap->prealloced_context ? *ic_ptr : NULL;
 
     pd->filename = "";
@@ -2620,7 +2620,7 @@ void avformat_free_context(AVFormatContext *s)
 
 void av_close_input_file(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->iformat->flags & AVFMT_NOFILE ? NULL : s->pb;
+    AVIOContext *pb = s->iformat->flags & AVFMT_NOFILE ? NULL : s->pb;
     av_close_input_stream(s);
     if (pb)
         url_fclose(pb);
diff --git a/libavformat/vc1test.c b/libavformat/vc1test.c
index 4221196..2120670 100644
--- a/libavformat/vc1test.c
+++ b/libavformat/vc1test.c
@@ -44,7 +44,7 @@ static int vc1t_probe(AVProbeData *p)
 static int vc1t_read_header(AVFormatContext *s,
                            AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     int frames;
     uint32_t fps;
@@ -87,7 +87,7 @@ static int vc1t_read_header(AVFormatContext *s,
 static int vc1t_read_packet(AVFormatContext *s,
                            AVPacket *pkt)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int frame_size;
     int keyframe = 0;
     uint32_t pts;
diff --git a/libavformat/vc1testenc.c b/libavformat/vc1testenc.c
index 52687d4..8b61892 100644
--- a/libavformat/vc1testenc.c
+++ b/libavformat/vc1testenc.c
@@ -27,7 +27,7 @@ typedef struct RCVContext {
 static int vc1test_write_header(AVFormatContext *s)
 {
     AVCodecContext *avc = s->streams[0]->codec;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     if (avc->codec_id != CODEC_ID_WMV3) {
         av_log(s, AV_LOG_ERROR, "Only WMV3 is accepted!\n");
@@ -55,7 +55,7 @@ static int vc1test_write_header(AVFormatContext *s)
 static int vc1test_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     RCVContext *ctx = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     if (!pkt->size)
         return 0;
@@ -71,7 +71,7 @@ static int vc1test_write_packet(AVFormatContext *s, AVPacket *pkt)
 static int vc1test_write_trailer(AVFormatContext *s)
 {
     RCVContext *ctx = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     if (!url_is_streamed(s->pb)) {
         url_fseek(pb, 0, SEEK_SET);
diff --git a/libavformat/vocdec.c b/libavformat/vocdec.c
index 0389701..347685a 100644
--- a/libavformat/vocdec.c
+++ b/libavformat/vocdec.c
@@ -41,7 +41,7 @@ static int voc_probe(AVProbeData *p)
 static int voc_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     VocDecContext *voc = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int header_size;
     AVStream *st;
 
@@ -66,7 +66,7 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
 {
     VocDecContext *voc = s->priv_data;
     AVCodecContext *dec = st->codec;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     VocType type;
     int size, tmp_codec=-1;
     int sample_rate = 0;
diff --git a/libavformat/vocenc.c b/libavformat/vocenc.c
index 745409f..92aeedc 100644
--- a/libavformat/vocenc.c
+++ b/libavformat/vocenc.c
@@ -29,7 +29,7 @@ typedef struct voc_enc_context {
 
 static int voc_write_header(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     const int header_size = 26;
     const int version = 0x0114;
 
@@ -49,7 +49,7 @@ static int voc_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     VocEncContext *voc = s->priv_data;
     AVCodecContext *enc = s->streams[0]->codec;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
 
     if (!voc->param_written) {
         if (enc->codec_tag > 0xFF) {
diff --git a/libavformat/wav.c b/libavformat/wav.c
index 5bc6098..ed8fa21 100644
--- a/libavformat/wav.c
+++ b/libavformat/wav.c
@@ -39,7 +39,7 @@ typedef struct {
 static int wav_write_header(AVFormatContext *s)
 {
     WAVContext *wav = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int64_t fmt, fact;
 
     avio_put_tag(pb, "RIFF");
@@ -77,7 +77,7 @@ static int wav_write_header(AVFormatContext *s)
 
 static int wav_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    ByteIOContext *pb  = s->pb;
+    AVIOContext *pb  = s->pb;
     WAVContext    *wav = s->priv_data;
     avio_put_buffer(pb, pkt->data, pkt->size);
     if(pkt->pts != AV_NOPTS_VALUE) {
@@ -91,7 +91,7 @@ static int wav_write_packet(AVFormatContext *s, AVPacket *pkt)
 
 static int wav_write_trailer(AVFormatContext *s)
 {
-    ByteIOContext *pb  = s->pb;
+    AVIOContext *pb  = s->pb;
     WAVContext    *wav = s->priv_data;
     int64_t file_size;
 
@@ -141,14 +141,14 @@ AVOutputFormat ff_wav_muxer = {
 
 #if CONFIG_WAV_DEMUXER
 
-static int64_t next_tag(ByteIOContext *pb, unsigned int *tag)
+static int64_t next_tag(AVIOContext *pb, unsigned int *tag)
 {
     *tag = avio_get_le32(pb);
     return avio_get_le32(pb);
 }
 
 /* return the size of the found tag */
-static int64_t find_tag(ByteIOContext *pb, uint32_t tag1)
+static int64_t find_tag(AVIOContext *pb, uint32_t tag1)
 {
     unsigned int tag;
     int64_t size;
@@ -192,7 +192,7 @@ static int wav_read_header(AVFormatContext *s,
     int64_t sample_count=0;
     int rf64;
     unsigned int tag;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     WAVContext *wav = s->priv_data;
 
@@ -263,7 +263,7 @@ static int wav_read_header(AVFormatContext *s,
 /** Find chunk with w64 GUID by skipping over other chunks
  * @return the size of the found chunk
  */
-static int64_t find_guid(ByteIOContext *pb, const uint8_t guid1[16])
+static int64_t find_guid(AVIOContext *pb, const uint8_t guid1[16])
 {
     uint8_t guid[16];
     int64_t size;
@@ -379,7 +379,7 @@ static int w64_probe(AVProbeData *p)
 static int w64_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     int64_t size;
-    ByteIOContext *pb  = s->pb;
+    AVIOContext *pb  = s->pb;
     WAVContext    *wav = s->priv_data;
     AVStream *st;
     uint8_t guid[16];
diff --git a/libavformat/wc3movie.c b/libavformat/wc3movie.c
index 2c9f55f..57ae93d 100644
--- a/libavformat/wc3movie.c
+++ b/libavformat/wc3movie.c
@@ -85,7 +85,7 @@ static int wc3_read_header(AVFormatContext *s,
                            AVFormatParameters *ap)
 {
     Wc3DemuxContext *wc3 = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned int fourcc_tag;
     unsigned int size;
     AVStream *st;
@@ -196,7 +196,7 @@ static int wc3_read_packet(AVFormatContext *s,
                            AVPacket *pkt)
 {
     Wc3DemuxContext *wc3 = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned int fourcc_tag;
     unsigned int size;
     int packet_read = 0;
diff --git a/libavformat/westwood.c b/libavformat/westwood.c
index f58199e..dac04d3 100644
--- a/libavformat/westwood.c
+++ b/libavformat/westwood.c
@@ -126,7 +126,7 @@ static int wsaud_read_header(AVFormatContext *s,
                              AVFormatParameters *ap)
 {
     WsAudDemuxContext *wsaud = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     unsigned char header[AUD_HEADER_SIZE];
 
@@ -168,7 +168,7 @@ static int wsaud_read_packet(AVFormatContext *s,
                              AVPacket *pkt)
 {
     WsAudDemuxContext *wsaud = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned char preamble[AUD_CHUNK_PREAMBLE_SIZE];
     unsigned int chunk_size;
     int ret = 0;
@@ -213,7 +213,7 @@ static int wsvqa_read_header(AVFormatContext *s,
                              AVFormatParameters *ap)
 {
     WsVqaDemuxContext *wsvqa = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
     unsigned char *header;
     unsigned char scratch[VQA_PREAMBLE_SIZE];
@@ -313,7 +313,7 @@ static int wsvqa_read_packet(AVFormatContext *s,
                              AVPacket *pkt)
 {
     WsVqaDemuxContext *wsvqa = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int ret = -1;
     unsigned char preamble[VQA_PREAMBLE_SIZE];
     unsigned int chunk_type;
diff --git a/libavformat/wtv.c b/libavformat/wtv.c
index 34474c5..acd50d4 100644
--- a/libavformat/wtv.c
+++ b/libavformat/wtv.c
@@ -57,7 +57,7 @@
 #define WTV_BIGSECTOR_BITS 18
 
 typedef struct {
-    ByteIOContext *pb_filesystem;  /** file system (AVFormatContext->pb) */
+    AVIOContext *pb_filesystem;  /** file system (AVFormatContext->pb) */
 
     int sector_bits;     /** sector shift bits; used to convert sector number into pb_filesystem offset */
     uint32_t *sectors;   /** file allocation table */
@@ -74,7 +74,7 @@ typedef struct {
 static int wtvfile_read_packet(void *opaque, uint8_t *buf, int buf_size)
 {
     WtvFile *wf = opaque;
-    ByteIOContext *pb = wf->pb_filesystem;
+    AVIOContext *pb = wf->pb_filesystem;
     int nread = 0;
 
     if (wf->error || url_ferror(pb))
@@ -113,7 +113,7 @@ static int wtvfile_read_packet(void *opaque, uint8_t *buf, int buf_size)
 static int64_t wtvfile_seek(void *opaque, int64_t offset, int whence)
 {
     WtvFile *wf = opaque;
-    ByteIOContext *pb = wf->pb_filesystem;
+    AVIOContext *pb = wf->pb_filesystem;
 
     if (whence == AVSEEK_SIZE)
         return wf->length;
@@ -136,7 +136,7 @@ static int64_t wtvfile_seek(void *opaque, int64_t offset, int whence)
  * @param     count maximum number of integers to read
  * @return    total number of integers read
  */
-static int read_ints(ByteIOContext *pb, uint32_t *data, int count)
+static int read_ints(AVIOContext *pb, uint32_t *data, int count)
 {
     int i, total = 0;
     for (i = 0; i < count; i++) {
@@ -153,9 +153,9 @@ static int read_ints(ByteIOContext *pb, uint32_t *data, int count)
  * @param depth         File allocation table depth
  * @return NULL on error
  */
-static ByteIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int depth, AVFormatContext *s)
+static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int depth, AVFormatContext *s)
 {
-    ByteIOContext *pb;
+    AVIOContext *pb;
     WtvFile *wf;
     uint8_t *buffer;
 
@@ -257,7 +257,7 @@ static const ff_asf_guid dir_entry_guid =
  * @param      filename_size size of filename
  * @return NULL on error
  */
-static ByteIOContext * wtvfile_open2(AVFormatContext *s, const uint8_t *buf, int buf_size, const uint8_t *filename, int filename_size)
+static AVIOContext * wtvfile_open2(AVFormatContext *s, const uint8_t *buf, int buf_size, const uint8_t *filename, int filename_size)
 {
     const uint8_t *buf_end = buf + buf_size;
 
@@ -298,7 +298,7 @@ static ByteIOContext * wtvfile_open2(AVFormatContext *s, const uint8_t *buf, int
 /**
  * Close file opened with wtvfile_open_sector(), or wtv_open()
  */
-static void wtvfile_close(ByteIOContext *pb)
+static void wtvfile_close(AVIOContext *pb)
 {
     WtvFile *wf = pb->opaque;
     av_free(wf->sectors);
@@ -316,7 +316,7 @@ typedef struct {
 } WtvStream;
 
 typedef struct {
-    ByteIOContext *pb;       /** timeline file */
+    AVIOContext *pb;       /** timeline file */
     int64_t epoch;
     int64_t pts;             /** pts for next data chunk */
     int64_t last_valid_pts;  /** latest valid pts, used for interative seeking */
@@ -462,7 +462,7 @@ static void oledate_to_iso8601(char *buf, int buf_size, int64_t value)
     strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", gmtime(&t));
 }
 
-static void get_attachment(AVFormatContext *s, ByteIOContext *pb, int length)
+static void get_attachment(AVFormatContext *s, AVIOContext *pb, int length)
 {
     char mime[1024];
     char description[1024];
@@ -495,7 +495,7 @@ done:
     url_fseek(pb, pos + length, SEEK_SET);
 }
 
-static void get_tag(AVFormatContext *s, ByteIOContext *pb, const char *key, int type, int length)
+static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int type, int length)
 {
     int buf_size = FFMAX(2*length, LEN_PRETTY_GUID) + 1;
     char *buf = av_malloc(buf_size);
@@ -550,7 +550,7 @@ static void get_tag(AVFormatContext *s, ByteIOContext *pb, const char *key, int
 /**
  * Parse metadata entries
  */
-static void parse_legacy_attrib(AVFormatContext *s, ByteIOContext *pb)
+static void parse_legacy_attrib(AVFormatContext *s, AVIOContext *pb)
 {
     ff_asf_guid guid;
     int length, type;
@@ -580,7 +580,7 @@ static void parse_legacy_attrib(AVFormatContext *s, ByteIOContext *pb)
 static int parse_videoinfoheader2(AVFormatContext *s, AVStream *st)
 {
     WtvContext *wtv = s->priv_data;
-    ByteIOContext *pb = wtv->pb;
+    AVIOContext *pb = wtv->pb;
 
     url_fskip(pb, 72);  // picture aspect ratio is unreliable
     ff_get_bmp_header(pb, st);
@@ -650,7 +650,7 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
                                    ff_asf_guid formattype, int size)
 {
     WtvContext *wtv = s->priv_data;
-    ByteIOContext *pb = wtv->pb;
+    AVIOContext *pb = wtv->pb;
     if (!ff_guidcmp(subtype, mediasubtype_cpfilters_processed) &&
         !ff_guidcmp(formattype, format_cpfilters_processed)) {
         ff_asf_guid actual_subtype;
@@ -769,7 +769,7 @@ enum {
 static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_ptr)
 {
     WtvContext *wtv = s->priv_data;
-    ByteIOContext *pb = wtv->pb;
+    AVIOContext *pb = wtv->pb;
     while (!url_feof(pb)) {
         ff_asf_guid g;
         int len, sid, consumed;
@@ -945,7 +945,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
     WtvContext *wtv = s->priv_data;
     int root_sector, root_size;
     uint8_t root[WTV_SECTOR_SIZE];
-    ByteIOContext *pb;
+    AVIOContext *pb;
     int64_t timeline_pos;
     int ret;
 
@@ -1035,7 +1035,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
 static int read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     WtvContext *wtv = s->priv_data;
-    ByteIOContext *pb = wtv->pb;
+    AVIOContext *pb = wtv->pb;
     int stream_index, len, ret;
 
     stream_index = parse_chunks(s, SEEK_TO_DATA, 0, &len);
@@ -1055,7 +1055,7 @@ static int read_seek(AVFormatContext *s, int stream_index,
                      int64_t ts, int flags)
 {
     WtvContext *wtv = s->priv_data;
-    ByteIOContext *pb = wtv->pb;
+    AVIOContext *pb = wtv->pb;
     AVStream *st = s->streams[0];
     int64_t ts_relative;
     int i;
diff --git a/libavformat/wv.c b/libavformat/wv.c
index 0e7ad55..e6d0268 100644
--- a/libavformat/wv.c
+++ b/libavformat/wv.c
@@ -76,7 +76,7 @@ static int wv_probe(AVProbeData *p)
         return 0;
 }
 
-static int wv_read_block_header(AVFormatContext *ctx, ByteIOContext *pb, int append)
+static int wv_read_block_header(AVFormatContext *ctx, AVIOContext *pb, int append)
 {
     WVContext *wc = ctx->priv_data;
     uint32_t tag, ver;
@@ -201,7 +201,7 @@ static int wv_read_block_header(AVFormatContext *ctx, ByteIOContext *pb, int app
 static int wv_read_header(AVFormatContext *s,
                           AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     WVContext *wc = s->priv_data;
     AVStream *st;
 
diff --git a/libavformat/xa.c b/libavformat/xa.c
index 8c3505d..f0ec228 100644
--- a/libavformat/xa.c
+++ b/libavformat/xa.c
@@ -66,7 +66,7 @@ static int xa_read_header(AVFormatContext *s,
                AVFormatParameters *ap)
 {
     MaxisXADemuxContext *xa = s->priv_data;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
 
     /*Set up the XA Audio Decoder*/
@@ -96,7 +96,7 @@ static int xa_read_packet(AVFormatContext *s,
 {
     MaxisXADemuxContext *xa = s->priv_data;
     AVStream *st = s->streams[0];
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     unsigned int packet_size;
     int ret;
 
diff --git a/libavformat/yop.c b/libavformat/yop.c
index b262943..4cfc3a6 100644
--- a/libavformat/yop.c
+++ b/libavformat/yop.c
@@ -50,7 +50,7 @@ static int yop_probe(AVProbeData *probe_packet)
 static int yop_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     YopDecContext *yop = s->priv_data;
-    ByteIOContext *pb  = s->pb;
+    AVIOContext *pb  = s->pb;
 
     AVCodecContext *audio_dec, *video_dec;
     AVStream *audio_stream, *video_stream;
@@ -114,7 +114,7 @@ static int yop_read_header(AVFormatContext *s, AVFormatParameters *ap)
 static int yop_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     YopDecContext *yop = s->priv_data;
-    ByteIOContext *pb  = s->pb;
+    AVIOContext *pb  = s->pb;
 
     int ret;
     int actual_video_data_size = yop->frame_size -
diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
index f1e029f..0556fc6 100644
--- a/libavformat/yuv4mpeg.c
+++ b/libavformat/yuv4mpeg.c
@@ -90,7 +90,7 @@ static int yuv4_generate_header(AVFormatContext *s, char* buf)
 static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     AVStream *st = s->streams[pkt->stream_index];
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVPicture *picture;
     int* first_pkt = s->priv_data;
     int width, height, h_chroma_shift, v_chroma_shift;
@@ -192,7 +192,7 @@ static int yuv4_read_header(AVFormatContext *s, AVFormatParameters *ap)
     char header[MAX_YUV4_HEADER+10];  // Include headroom for the longest option
     char *tokstart,*tokend,*header_end;
     int i;
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     int width=-1, height=-1, raten=0, rated=0, aspectn=0, aspectd=0;
     enum PixelFormat pix_fmt=PIX_FMT_NONE,alt_pix_fmt=PIX_FMT_NONE;
     enum AVChromaLocation chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED;
-- 
1.7.2.3




More information about the ffmpeg-devel mailing list