aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/sauce.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-02-21 16:43:01 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-02-22 02:44:37 +0100
commite63a362857d9807b23e65872598d782fa53bb6af (patch)
tree7a21287e54bfbd2ec9c45bcb5a22e441e4992f2b /libavformat/sauce.c
parent6a786b15c34765ec00be3cd808dafbb041fd5881 (diff)
downloadffmpeg-e63a362857d9807b23e65872598d782fa53bb6af.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> (cherry picked from commit b7effd4e8338f6ed5bda630ad7ed0809bf458648)
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';
}