diff options
author | Anton Khirnov | 2011-01-21 19:18:07 +0000 |
---|---|---|
committer | Mans Rullgard | 2011-01-21 20:21:03 +0000 |
commit | 4efd5cf34b7a04f87805aa0f09913d1d122d300c (patch) | |
tree | fee5313b3fd0435d44cab3e47a5dde79e1405576 /libavformat/aviobuf.c | |
parent | 1c189fc5334d4a687b15861d81d22c8ba2c9cd5e (diff) |
avio: add av_put_str and deprecate put_strz in favor of it
Signed-off-by: Mans Rullgard <mans@mansr.com>
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){ |