Commit d9d86e00 authored by Anton Khirnov's avatar Anton Khirnov Committed by Ronald S. Bultje

avio: avio_ prefix for url_fprintf

Signed-off-by: 's avatarRonald S. Bultje <rsbultje@gmail.com>
parent af020732
This diff is collapsed.
...@@ -430,6 +430,11 @@ attribute_deprecated int64_t url_fsize(AVIOContext *s); ...@@ -430,6 +430,11 @@ attribute_deprecated int64_t url_fsize(AVIOContext *s);
#define URL_EOF (-1) #define URL_EOF (-1)
attribute_deprecated int url_fgetc(AVIOContext *s); attribute_deprecated int url_fgetc(AVIOContext *s);
attribute_deprecated int url_setbufsize(AVIOContext *s, int buf_size); 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, ...@@ -513,9 +518,9 @@ int64_t av_url_read_fseek(AVIOContext *h, int stream_index,
/** @warning currently size is limited */ /** @warning currently size is limited */
#ifdef __GNUC__ #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 #else
int url_fprintf(AVIOContext *s, const char *fmt, ...); int avio_printf(AVIOContext *s, const char *fmt, ...);
#endif #endif
#if FF_API_OLD_AVIO #if FF_API_OLD_AVIO
......
...@@ -381,6 +381,18 @@ int url_setbufsize(AVIOContext *s, int buf_size) ...@@ -381,6 +381,18 @@ int url_setbufsize(AVIOContext *s, int buf_size)
{ {
return ffio_set_buf_size(s, 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 #endif
int avio_put_str(AVIOContext *s, const char *str) int avio_put_str(AVIOContext *s, const char *str)
...@@ -913,7 +925,7 @@ URLContext *url_fileno(AVIOContext *s) ...@@ -913,7 +925,7 @@ URLContext *url_fileno(AVIOContext *s)
} }
#if CONFIG_MUXERS #if CONFIG_MUXERS
int url_fprintf(AVIOContext *s, const char *fmt, ...) int avio_printf(AVIOContext *s, const char *fmt, ...)
{ {
va_list ap; va_list ap;
char buf[4096]; char buf[4096];
......
...@@ -73,9 +73,9 @@ static int write_trailer(AVFormatContext *s) ...@@ -73,9 +73,9 @@ static int write_trailer(AVFormatContext *s)
AVChapter *ch = s->chapters[i]; AVChapter *ch = s->chapters[i];
avio_write(s->pb, ID_CHAPTER, sizeof(ID_CHAPTER) - 1); avio_write(s->pb, ID_CHAPTER, sizeof(ID_CHAPTER) - 1);
avio_w8(s->pb, '\n'); avio_w8(s->pb, '\n');
url_fprintf(s->pb, "TIMEBASE=%d/%d\n", ch->time_base.num, ch->time_base.den); avio_printf(s->pb, "TIMEBASE=%d/%d\n", ch->time_base.num, ch->time_base.den);
url_fprintf(s->pb, "START=%"PRId64"\n", ch->start); avio_printf(s->pb, "START=%"PRId64"\n", ch->start);
url_fprintf(s->pb, "END=%"PRId64"\n", ch->end); avio_printf(s->pb, "END=%"PRId64"\n", ch->end);
write_tags(s->pb, ch->metadata); write_tags(s->pb, ch->metadata);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment