aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/sauce.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/sauce.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/sauce.c')
-rw-r--r--libavformat/sauce.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libavformat/sauce.c b/libavformat/sauce.c
index 32c026cd34..e861b14e16 100644
--- a/libavformat/sauce.c
+++ b/libavformat/sauce.c
@@ -36,13 +36,13 @@ int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int g
uint64_t start_pos = url_fsize(pb) - 128;
url_fseek(pb, start_pos, SEEK_SET);
- if (get_buffer(pb, buf, 7) != 7)
+ if (avio_read(pb, buf, 7) != 7)
return -1;
if (memcmp(buf, "SAUCE00", 7))
return -1;
#define GET_SAUCE_META(name,size) \
- if (get_buffer(pb, buf, size) == size && buf[0]) { \
+ if (avio_read(pb, buf, size) == size && buf[0]) { \
buf[size] = 0; \
av_metadata_set2(&avctx->metadata, name, buf, 0); \
}
@@ -52,12 +52,12 @@ int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int g
GET_SAUCE_META("publisher", 20)
GET_SAUCE_META("date", 8)
url_fskip(pb, 4);
- datatype = get_byte(pb);
- filetype = get_byte(pb);
- t1 = get_le16(pb);
- t2 = get_le16(pb);
- nb_comments = get_byte(pb);
- flags = get_byte(pb);
+ datatype = avio_r8(pb);
+ filetype = avio_r8(pb);
+ t1 = avio_rl16(pb);
+ t2 = avio_rl16(pb);
+ nb_comments = avio_r8(pb);
+ flags = avio_r8(pb);
url_fskip(pb, 4);
GET_SAUCE_META("encoder", 22);
@@ -83,14 +83,14 @@ int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int g
if (nb_comments > 0) {
url_fseek(pb, start_pos - 64*nb_comments - 5, SEEK_SET);
- if (get_buffer(pb, buf, 5) == 5 && !memcmp(buf, "COMNT", 5)) {
+ if (avio_read(pb, buf, 5) == 5 && !memcmp(buf, "COMNT", 5)) {
int i;
char *str = av_malloc(65*nb_comments + 1);
*fsize -= 64*nb_comments + 5;
if (!str)
return 0;
for (i = 0; i < nb_comments; i++) {
- if (get_buffer(pb, str + 65*i, 64) != 64)
+ if (avio_read(pb, str + 65*i, 64) != 64)
break;
str[65*i + 64] = '\n';
}