aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/aviobuf.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-01-21 19:18:08 +0000
committerMichael Niedermayer <michaelni@gmx.at>2011-01-23 19:32:06 +0100
commit6e89b61293f8c1020e0346f1e1860bd642ce38e0 (patch)
tree95d848b5c30536845717346f5bb148f3343db823 /libavformat/aviobuf.c
parente910a77b0d203870253eaa8ec43527560221268d (diff)
downloadffmpeg-6e89b61293f8c1020e0346f1e1860bd642ce38e0.tar.gz
lavf: move ff_put_str16_nolen from asf to avio and rename it
It will be useful in the mp3 muxer. Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit dccbd97d72991f4df63542e1ee03db2f8d7a0238)
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r--libavformat/aviobuf.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 4f0c16c308..5aeced1b9f 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -283,6 +283,23 @@ int avio_put_str(ByteIOContext *s, const char *str)
return len;
}
+int avio_put_str16le(ByteIOContext *s, const char *str)
+{
+ const uint8_t *q = str;
+ int ret = 0;
+
+ while (*q) {
+ uint32_t ch;
+ uint16_t tmp;
+
+ GET_UTF8(ch, *q++, break;)
+ PUT_UTF16(ch, tmp, put_le16(s, tmp);ret += 2;)
+ }
+ put_le16(s, 0);
+ ret += 2;
+ return ret;
+}
+
int ff_get_v_length(uint64_t val){
int i=1;