summaryrefslogtreecommitdiff
path: root/libavformat/mpc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-02-21 16:43:01 +0100
committerRonald S. Bultje <rsbultje@gmail.com>2011-02-21 11:23:22 -0500
commitb7effd4e8338f6ed5bda630ad7ed0809bf458648 (patch)
tree53c878f6dd48c313a9bcde1855c2b4e009822c9e /libavformat/mpc.c
parentf8bed30d8b176fa030f6737765338bb4a2bcabc9 (diff)
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>
Diffstat (limited to 'libavformat/mpc.c')
-rw-r--r--libavformat/mpc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavformat/mpc.c b/libavformat/mpc.c
index aa0572603f..73217a31ea 100644
--- a/libavformat/mpc.c
+++ b/libavformat/mpc.c
@@ -55,16 +55,16 @@ static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap)
MPCContext *c = s->priv_data;
AVStream *st;
- if(get_le24(s->pb) != MKTAG('M', 'P', '+', 0)){
+ if(avio_rl24(s->pb) != MKTAG('M', 'P', '+', 0)){
av_log(s, AV_LOG_ERROR, "Not a Musepack file\n");
return -1;
}
- c->ver = get_byte(s->pb);
+ c->ver = avio_r8(s->pb);
if(c->ver != 0x07 && c->ver != 0x17){
av_log(s, AV_LOG_ERROR, "Can demux Musepack SV7, got version %02X\n", c->ver);
return -1;
}
- c->fcount = get_le32(s->pb);
+ c->fcount = avio_rl32(s->pb);
if((int64_t)c->fcount * sizeof(MPCFrame) >= UINT_MAX){
av_log(s, AV_LOG_ERROR, "Too many frames, seeking is not possible\n");
return -1;
@@ -85,7 +85,7 @@ static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->extradata_size = 16;
st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE);
- get_buffer(s->pb, st->codec->extradata, 16);
+ avio_read(s->pb, st->codec->extradata, 16);
st->codec->sample_rate = mpc_rate[st->codec->extradata[2] & 3];
av_set_pts_info(st, 32, MPC_FRAMESIZE, st->codec->sample_rate);
/* scan for seekpoints */
@@ -121,11 +121,11 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
c->curframe++;
curbits = c->curbits;
pos = url_ftell(s->pb);
- tmp = get_le32(s->pb);
+ tmp = avio_rl32(s->pb);
if(curbits <= 12){
size2 = (tmp >> (12 - curbits)) & 0xFFFFF;
}else{
- tmp = (tmp << 32) | get_le32(s->pb);
+ tmp = (tmp << 32) | avio_rl32(s->pb);
size2 = (tmp >> (44 - curbits)) & 0xFFFFF;
}
curbits += 20;
@@ -151,7 +151,7 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->stream_index = 0;
pkt->pts = cur;
- ret = get_buffer(s->pb, pkt->data + 4, size);
+ ret = avio_read(s->pb, pkt->data + 4, size);
if(c->curbits)
url_fseek(s->pb, -4, SEEK_CUR);
if(ret < size){