summaryrefslogtreecommitdiff
path: root/libavformat/ape.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/ape.c')
-rw-r--r--libavformat/ape.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/libavformat/ape.c b/libavformat/ape.c
index 53b609fe4d..862ac1a482 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -162,11 +162,11 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
/* TODO: Skip any leading junk such as id3v2 tags */
ape->junklength = 0;
- tag = get_le32(pb);
+ tag = avio_rl32(pb);
if (tag != MKTAG('M', 'A', 'C', ' '))
return -1;
- ape->fileversion = get_le16(pb);
+ ape->fileversion = avio_rl16(pb);
if (ape->fileversion < APE_MIN_VERSION || ape->fileversion > APE_MAX_VERSION) {
av_log(s, AV_LOG_ERROR, "Unsupported file version - %d.%02d\n", ape->fileversion / 1000, (ape->fileversion % 1000) / 10);
@@ -174,15 +174,15 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
}
if (ape->fileversion >= 3980) {
- ape->padding1 = get_le16(pb);
- ape->descriptorlength = get_le32(pb);
- ape->headerlength = get_le32(pb);
- ape->seektablelength = get_le32(pb);
- ape->wavheaderlength = get_le32(pb);
- ape->audiodatalength = get_le32(pb);
- ape->audiodatalength_high = get_le32(pb);
- ape->wavtaillength = get_le32(pb);
- get_buffer(pb, ape->md5, 16);
+ ape->padding1 = avio_rl16(pb);
+ ape->descriptorlength = avio_rl32(pb);
+ ape->headerlength = avio_rl32(pb);
+ ape->seektablelength = avio_rl32(pb);
+ ape->wavheaderlength = avio_rl32(pb);
+ ape->audiodatalength = avio_rl32(pb);
+ ape->audiodatalength_high = avio_rl32(pb);
+ ape->wavtaillength = avio_rl32(pb);
+ avio_read(pb, ape->md5, 16);
/* Skip any unknown bytes at the end of the descriptor.
This is for future compatibility */
@@ -190,26 +190,26 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
url_fseek(pb, ape->descriptorlength - 52, SEEK_CUR);
/* Read header data */
- ape->compressiontype = get_le16(pb);
- ape->formatflags = get_le16(pb);
- ape->blocksperframe = get_le32(pb);
- ape->finalframeblocks = get_le32(pb);
- ape->totalframes = get_le32(pb);
- ape->bps = get_le16(pb);
- ape->channels = get_le16(pb);
- ape->samplerate = get_le32(pb);
+ ape->compressiontype = avio_rl16(pb);
+ ape->formatflags = avio_rl16(pb);
+ ape->blocksperframe = avio_rl32(pb);
+ ape->finalframeblocks = avio_rl32(pb);
+ ape->totalframes = avio_rl32(pb);
+ ape->bps = avio_rl16(pb);
+ ape->channels = avio_rl16(pb);
+ ape->samplerate = avio_rl32(pb);
} else {
ape->descriptorlength = 0;
ape->headerlength = 32;
- ape->compressiontype = get_le16(pb);
- ape->formatflags = get_le16(pb);
- ape->channels = get_le16(pb);
- ape->samplerate = get_le32(pb);
- ape->wavheaderlength = get_le32(pb);
- ape->wavtaillength = get_le32(pb);
- ape->totalframes = get_le32(pb);
- ape->finalframeblocks = get_le32(pb);
+ ape->compressiontype = avio_rl16(pb);
+ ape->formatflags = avio_rl16(pb);
+ ape->channels = avio_rl16(pb);
+ ape->samplerate = avio_rl32(pb);
+ ape->wavheaderlength = avio_rl32(pb);
+ ape->wavtaillength = avio_rl32(pb);
+ ape->totalframes = avio_rl32(pb);
+ ape->finalframeblocks = avio_rl32(pb);
if (ape->formatflags & MAC_FORMAT_FLAG_HAS_PEAK_LEVEL) {
url_fseek(pb, 4, SEEK_CUR); /* Skip the peak level */
@@ -217,7 +217,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
}
if (ape->formatflags & MAC_FORMAT_FLAG_HAS_SEEK_ELEMENTS) {
- ape->seektablelength = get_le32(pb);
+ ape->seektablelength = avio_rl32(pb);
ape->headerlength += 4;
ape->seektablelength *= sizeof(int32_t);
} else
@@ -260,7 +260,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
if (ape->seektablelength > 0) {
ape->seektable = av_malloc(ape->seektablelength);
for (i = 0; i < ape->seektablelength / sizeof(uint32_t); i++)
- ape->seektable[i] = get_le32(pb);
+ ape->seektable[i] = avio_rl32(pb);
}
ape->frames[0].pos = ape->firstframe;
@@ -355,7 +355,7 @@ static int ape_read_packet(AVFormatContext * s, AVPacket * pkt)
AV_WL32(pkt->data , nblocks);
AV_WL32(pkt->data + 4, ape->frames[ape->currentframe].skip);
- ret = get_buffer(s->pb, pkt->data + extra_size, ape->frames[ape->currentframe].size);
+ ret = avio_read(s->pb, pkt->data + extra_size, ape->frames[ape->currentframe].size);
pkt->pts = ape->frames[ape->currentframe].pts;
pkt->stream_index = 0;