diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-01-21 19:18:07 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-01-23 19:32:06 +0100 |
commit | e910a77b0d203870253eaa8ec43527560221268d (patch) | |
tree | fa6fc3a5daa3ca21ccdd945291f270c1144b055e /libavformat/aviobuf.c | |
parent | 384dbd617f7c28950e902634d400189f22033202 (diff) | |
download | ffmpeg-e910a77b0d203870253eaa8ec43527560221268d.tar.gz |
avio: add av_put_str and deprecate put_strz in favor of it
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 4efd5cf34b7a04f87805aa0f09913d1d122d300c)
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index df76507866..4f0c16c308 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -265,12 +265,22 @@ void put_be32(ByteIOContext *s, unsigned int val) put_byte(s, val); } +#if FF_API_OLD_AVIO void put_strz(ByteIOContext *s, const char *str) { - if (str) - put_buffer(s, (const unsigned char *) str, strlen(str) + 1); - else + avio_put_str(s, str); +} +#endif + +int avio_put_str(ByteIOContext *s, const char *str) +{ + int len = 1; + if (str) { + len += strlen(str); + put_buffer(s, (const unsigned char *) str, len); + } else put_byte(s, 0); + return len; } int ff_get_v_length(uint64_t val){ |