aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mp3enc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-02-21 19:28:17 +0100
committerRonald S. Bultje <rsbultje@gmail.com>2011-02-21 14:25:15 -0500
commit77eb5504d3b3e1047900382350e0bc5e0bfb16b5 (patch)
treeadb31feb8accd7dbaaa2ce1baf48fee96664abe1 /libavformat/mp3enc.c
parent78e2380a6d09e7a8b2a74d090abfb0a922e046f6 (diff)
downloadffmpeg-77eb5504d3b3e1047900382350e0bc5e0bfb16b5.tar.gz
avio: avio: avio_ prefixes for put_* functions
In the name of consistency: put_byte -> avio_w8 put_<type> -> avio_w<type> put_buffer -> avio_write put_nbyte will be made private put_tag will be merged with avio_put_str Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavformat/mp3enc.c')
-rw-r--r--libavformat/mp3enc.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index cdecda67c3..0635228f61 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -71,10 +71,10 @@ static int id3v1_create_tag(AVFormatContext *s, uint8_t *buf)
static void id3v2_put_size(AVFormatContext *s, int size)
{
- put_byte(s->pb, size >> 21 & 0x7f);
- put_byte(s->pb, size >> 14 & 0x7f);
- put_byte(s->pb, size >> 7 & 0x7f);
- put_byte(s->pb, size & 0x7f);
+ avio_w8(s->pb, size >> 21 & 0x7f);
+ avio_w8(s->pb, size >> 14 & 0x7f);
+ avio_w8(s->pb, size >> 7 & 0x7f);
+ avio_w8(s->pb, size & 0x7f);
}
static int string_is_ascii(const uint8_t *str)
@@ -104,9 +104,9 @@ static int id3v2_put_ttag(AVFormatContext *s, const char *str1, const char *str2
(!str2 || string_is_ascii(str2)))
enc = ID3v2_ENCODING_ISO8859;
- put_byte(dyn_buf, enc);
+ avio_w8(dyn_buf, enc);
if (enc == ID3v2_ENCODING_UTF16BOM) {
- put_le16(dyn_buf, 0xFEFF); /* BOM */
+ avio_wl16(dyn_buf, 0xFEFF); /* BOM */
put = avio_put_str16le;
} else
put = avio_put_str;
@@ -116,10 +116,10 @@ static int id3v2_put_ttag(AVFormatContext *s, const char *str1, const char *str2
put(dyn_buf, str2);
len = url_close_dyn_buf(dyn_buf, &pb);
- put_be32(s->pb, tag);
+ avio_wb32(s->pb, tag);
id3v2_put_size(s, len);
- put_be16(s->pb, 0);
- put_buffer(s->pb, pb, len);
+ avio_wb16(s->pb, 0);
+ avio_write(s->pb, pb, len);
av_freep(&pb);
return len + ID3v2_HEADER_SIZE;
@@ -128,7 +128,7 @@ static int id3v2_put_ttag(AVFormatContext *s, const char *str1, const char *str2
static int mp3_write_packet(struct AVFormatContext *s, AVPacket *pkt)
{
- put_buffer(s->pb, pkt->data, pkt->size);
+ avio_write(s->pb, pkt->data, pkt->size);
put_flush_packet(s->pb);
return 0;
}
@@ -139,7 +139,7 @@ static int mp3_write_trailer(struct AVFormatContext *s)
/* write the id3v1 tag */
if (id3v1_create_tag(s, buf) > 0) {
- put_buffer(s->pb, buf, ID3v1_TAG_SIZE);
+ avio_write(s->pb, buf, ID3v1_TAG_SIZE);
put_flush_packet(s->pb);
}
return 0;
@@ -206,13 +206,13 @@ static int mp3_write_header(struct AVFormatContext *s)
ID3v2_ENCODING_UTF8;
int64_t size_pos, cur_pos;
- put_be32(s->pb, MKBETAG('I', 'D', '3', mp3->id3v2_version));
- put_byte(s->pb, 0);
- put_byte(s->pb, 0); /* flags */
+ avio_wb32(s->pb, MKBETAG('I', 'D', '3', mp3->id3v2_version));
+ avio_w8(s->pb, 0);
+ avio_w8(s->pb, 0); /* flags */
/* reserve space for size */
size_pos = url_ftell(s->pb);
- put_be32(s->pb, 0);
+ avio_wb32(s->pb, 0);
ff_metadata_conv(&s->metadata, ff_id3v2_34_metadata_conv, NULL);
if (mp3->id3v2_version == 4)