diff options
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 17 |
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; |