diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-02-21 16:43:01 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-02-22 02:44:37 +0100 |
commit | e63a362857d9807b23e65872598d782fa53bb6af (patch) | |
tree | 7a21287e54bfbd2ec9c45bcb5a22e441e4992f2b /libavformat/dxa.c | |
parent | 6a786b15c34765ec00be3cd808dafbb041fd5881 (diff) | |
download | ffmpeg-e63a362857d9807b23e65872598d782fa53bb6af.tar.gz |
avio: avio_ prefixes for get_* functions
In the name of consistency:
get_byte -> avio_r8
get_<type> -> avio_r<type>
get_buffer -> avio_read
get_partial_buffer will be made private later
get_strz is left out becase I want to change it later to return
something useful.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit b7effd4e8338f6ed5bda630ad7ed0809bf458648)
Diffstat (limited to 'libavformat/dxa.c')
-rw-r--r-- | libavformat/dxa.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libavformat/dxa.c b/libavformat/dxa.c index a10ece8c8b..188fc29d63 100644 --- a/libavformat/dxa.c +++ b/libavformat/dxa.c @@ -61,17 +61,17 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap) int num, den; int flags; - tag = get_le32(pb); + tag = avio_rl32(pb); if (tag != MKTAG('D', 'E', 'X', 'A')) return -1; - flags = get_byte(pb); - c->frames = get_be16(pb); + flags = avio_r8(pb); + c->frames = avio_rb16(pb); if(!c->frames){ av_log(s, AV_LOG_ERROR, "File contains no frames ???\n"); return -1; } - fps = get_be32(pb); + fps = avio_rb32(pb); if(fps > 0){ den = 1000; num = fps; @@ -82,8 +82,8 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap) den = 10; num = 1; } - w = get_be16(pb); - h = get_be16(pb); + w = avio_rb16(pb); + h = avio_rb16(pb); c->has_sound = 0; st = av_new_stream(s, 0); @@ -91,13 +91,13 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap) return -1; // Parse WAV data header - if(get_le32(pb) == MKTAG('W', 'A', 'V', 'E')){ + if(avio_rl32(pb) == MKTAG('W', 'A', 'V', 'E')){ uint32_t size, fsize; c->has_sound = 1; - size = get_be32(pb); + size = avio_rb32(pb); c->vidpos = url_ftell(pb) + size; url_fskip(pb, 16); - fsize = get_le32(pb); + fsize = avio_rl32(pb); ast = av_new_stream(s, 0); if (!ast) @@ -105,8 +105,8 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap) ff_get_wav_header(pb, ast->codec, fsize); // find 'data' chunk while(url_ftell(pb) < c->vidpos && !url_feof(pb)){ - tag = get_le32(pb); - fsize = get_le32(pb); + tag = avio_rl32(pb); + fsize = avio_rl32(pb); if(tag == MKTAG('d', 'a', 't', 'a')) break; url_fskip(pb, fsize); } @@ -163,7 +163,7 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt) } url_fseek(s->pb, c->vidpos, SEEK_SET); while(!url_feof(s->pb) && c->frames){ - get_buffer(s->pb, buf, 4); + avio_read(s->pb, buf, 4); switch(AV_RL32(buf)){ case MKTAG('N', 'U', 'L', 'L'): if(av_new_packet(pkt, 4 + pal_size) < 0) @@ -178,10 +178,10 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt) case MKTAG('C', 'M', 'A', 'P'): pal_size = 768+4; memcpy(pal, buf, 4); - get_buffer(s->pb, pal + 4, 768); + avio_read(s->pb, pal + 4, 768); break; case MKTAG('F', 'R', 'A', 'M'): - get_buffer(s->pb, buf + 4, DXA_EXTRA_SIZE - 4); + avio_read(s->pb, buf + 4, DXA_EXTRA_SIZE - 4); size = AV_RB32(buf + 5); if(size > 0xFFFFFF){ av_log(s, AV_LOG_ERROR, "Frame size is too big: %d\n", size); @@ -190,7 +190,7 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt) if(av_new_packet(pkt, size + DXA_EXTRA_SIZE + pal_size) < 0) return AVERROR(ENOMEM); memcpy(pkt->data + pal_size, buf, DXA_EXTRA_SIZE); - ret = get_buffer(s->pb, pkt->data + DXA_EXTRA_SIZE + pal_size, size); + ret = avio_read(s->pb, pkt->data + DXA_EXTRA_SIZE + pal_size, size); if(ret != size){ av_free_packet(pkt); return AVERROR(EIO); |