aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-03-14 20:39:02 +0100
committerRonald S. Bultje <rsbultje@gmail.com>2011-03-16 22:59:39 -0400
commitd9d86e00b2891a2651fd41f0d2d220a67f7968c3 (patch)
tree1f5ad873dd78d180b24dba6bc56cf404fa474535 /libavformat
parentaf02073225e5b34a8ea72bd3ff531868ed0b5061 (diff)
downloadffmpeg-d9d86e00b2891a2651fd41f0d2d220a67f7968c3.tar.gz
avio: avio_ prefix for url_fprintf
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avio.h9
-rw-r--r--libavformat/aviobuf.c14
-rw-r--r--libavformat/ffmetaenc.c6
3 files changed, 23 insertions, 6 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 9f45a6bd87..5388c39c1e 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -430,6 +430,11 @@ attribute_deprecated int64_t url_fsize(AVIOContext *s);
#define URL_EOF (-1)
attribute_deprecated int url_fgetc(AVIOContext *s);
attribute_deprecated int url_setbufsize(AVIOContext *s, int buf_size);
+#ifdef __GNUC__
+attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
+#else
+attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...);
+#endif
/**
* @}
*/
@@ -513,9 +518,9 @@ int64_t av_url_read_fseek(AVIOContext *h, int stream_index,
/** @warning currently size is limited */
#ifdef __GNUC__
-int url_fprintf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
+int avio_printf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
#else
-int url_fprintf(AVIOContext *s, const char *fmt, ...);
+int avio_printf(AVIOContext *s, const char *fmt, ...);
#endif
#if FF_API_OLD_AVIO
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 7d84b2b293..7fbe4ce76c 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -381,6 +381,18 @@ int url_setbufsize(AVIOContext *s, int buf_size)
{
return ffio_set_buf_size(s, buf_size);
}
+int url_fprintf(AVIOContext *s, const char *fmt, ...)
+{
+ va_list ap;
+ char buf[4096];
+ int ret;
+
+ va_start(ap, fmt);
+ ret = vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+ avio_write(s, buf, strlen(buf));
+ return ret;
+}
#endif
int avio_put_str(AVIOContext *s, const char *str)
@@ -913,7 +925,7 @@ URLContext *url_fileno(AVIOContext *s)
}
#if CONFIG_MUXERS
-int url_fprintf(AVIOContext *s, const char *fmt, ...)
+int avio_printf(AVIOContext *s, const char *fmt, ...)
{
va_list ap;
char buf[4096];
diff --git a/libavformat/ffmetaenc.c b/libavformat/ffmetaenc.c
index 77db0b9bf8..70940c0e09 100644
--- a/libavformat/ffmetaenc.c
+++ b/libavformat/ffmetaenc.c
@@ -73,9 +73,9 @@ static int write_trailer(AVFormatContext *s)
AVChapter *ch = s->chapters[i];
avio_write(s->pb, ID_CHAPTER, sizeof(ID_CHAPTER) - 1);
avio_w8(s->pb, '\n');
- url_fprintf(s->pb, "TIMEBASE=%d/%d\n", ch->time_base.num, ch->time_base.den);
- url_fprintf(s->pb, "START=%"PRId64"\n", ch->start);
- url_fprintf(s->pb, "END=%"PRId64"\n", ch->end);
+ avio_printf(s->pb, "TIMEBASE=%d/%d\n", ch->time_base.num, ch->time_base.den);
+ avio_printf(s->pb, "START=%"PRId64"\n", ch->start);
+ avio_printf(s->pb, "END=%"PRId64"\n", ch->end);
write_tags(s->pb, ch->metadata);
}