mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-01-06 22:25:36 +01:00
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>
This commit is contained in:
committed by
Ronald S. Bultje
parent
f8bed30d8b
commit
b7effd4e83
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user