aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/cafdec.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/cafdec.c
parentf8bed30d8b176fa030f6737765338bb4a2bcabc9 (diff)
downloadffmpeg-b7effd4e8338f6ed5bda630ad7ed0809bf458648.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>
Diffstat (limited to 'libavformat/cafdec.c')
-rw-r--r--libavformat/cafdec.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index 27e29a2ea8..86f1005fdc 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -65,14 +65,14 @@ static int read_desc_chunk(AVFormatContext *s)
/* parse format description */
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- st->codec->sample_rate = av_int2dbl(get_be64(pb));
- st->codec->codec_tag = get_be32(pb);
- flags = get_be32(pb);
- caf->bytes_per_packet = get_be32(pb);
+ st->codec->sample_rate = av_int2dbl(avio_rb64(pb));
+ st->codec->codec_tag = avio_rb32(pb);
+ flags = avio_rb32(pb);
+ caf->bytes_per_packet = avio_rb32(pb);
st->codec->block_align = caf->bytes_per_packet;
- caf->frames_per_packet = get_be32(pb);
- st->codec->channels = get_be32(pb);
- st->codec->bits_per_coded_sample = get_be32(pb);
+ caf->frames_per_packet = avio_rb32(pb);
+ st->codec->channels = avio_rb32(pb);
+ st->codec->bits_per_coded_sample = avio_rb32(pb);
/* calculate bit rate for constant size packets */
if (caf->frames_per_packet > 0 && caf->bytes_per_packet > 0) {
@@ -127,14 +127,14 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size)
st->codec->extradata = av_mallocz(ALAC_HEADER + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
return AVERROR(ENOMEM);
- get_buffer(pb, st->codec->extradata, ALAC_HEADER);
+ avio_read(pb, st->codec->extradata, ALAC_HEADER);
st->codec->extradata_size = ALAC_HEADER;
url_fskip(pb, size - ALAC_PREAMBLE - ALAC_HEADER);
} else {
st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
return AVERROR(ENOMEM);
- get_buffer(pb, st->codec->extradata, size);
+ avio_read(pb, st->codec->extradata, size);
st->codec->extradata_size = size;
}
@@ -152,13 +152,13 @@ static int read_pakt_chunk(AVFormatContext *s, int64_t size)
ccount = url_ftell(pb);
- num_packets = get_be64(pb);
+ num_packets = avio_rb64(pb);
if (num_packets < 0 || INT32_MAX / sizeof(AVIndexEntry) < num_packets)
return AVERROR_INVALIDDATA;
- st->nb_frames = get_be64(pb); /* valid frames */
- st->nb_frames += get_be32(pb); /* priming frames */
- st->nb_frames += get_be32(pb); /* remainder frames */
+ st->nb_frames = avio_rb64(pb); /* valid frames */
+ st->nb_frames += avio_rb32(pb); /* priming frames */
+ st->nb_frames += avio_rb32(pb); /* remainder frames */
st->duration = 0;
for (i = 0; i < num_packets; i++) {
@@ -181,7 +181,7 @@ static void read_info_chunk(AVFormatContext *s, int64_t size)
{
AVIOContext *pb = s->pb;
unsigned int i;
- unsigned int nb_entries = get_be32(pb);
+ unsigned int nb_entries = avio_rb32(pb);
for (i = 0; i < nb_entries; i++) {
char key[32];
char value[1024];
@@ -204,11 +204,11 @@ static int read_header(AVFormatContext *s,
url_fskip(pb, 8); /* magic, version, file flags */
/* audio description chunk */
- if (get_be32(pb) != MKBETAG('d','e','s','c')) {
+ if (avio_rb32(pb) != MKBETAG('d','e','s','c')) {
av_log(s, AV_LOG_ERROR, "desc chunk not present\n");
return AVERROR_INVALIDDATA;
}
- size = get_be64(pb);
+ size = avio_rb64(pb);
if (size != 32)
return AVERROR_INVALIDDATA;
@@ -226,8 +226,8 @@ static int read_header(AVFormatContext *s,
if (found_data && (caf->data_size < 0 || url_is_streamed(pb)))
break;
- tag = get_be32(pb);
- size = get_be64(pb);
+ tag = avio_rb32(pb);
+ size = avio_rb64(pb);
if (url_feof(pb))
break;