diff options
author | Zhentan Feng <spyfeng@gmail.com> | 2010-03-24 18:40:43 +0000 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2010-03-24 18:40:43 +0000 |
commit | 852e0ca555514eb103a662df4f104cd596ed7cdf (patch) | |
tree | 1f35583559f9c31869acf86d58e813f598a82805 /libavformat/asf.c | |
parent | 508f092a783f7d305d1e9938c953e375139e2cba (diff) | |
download | ffmpeg-852e0ca555514eb103a662df4f104cd596ed7cdf.tar.gz |
Move put_le16_nolen() to asf.c and give it a ff_ prefix. This way, it is easier
to share it with e.g. MMS.
Patch by Zhentan Feng <spyfeng gmail com>.
Originally committed as revision 22656 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/asf.c')
-rw-r--r-- | libavformat/asf.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavformat/asf.c b/libavformat/asf.c index 20bfd8de1e..ea577cbbd7 100644 --- a/libavformat/asf.c +++ b/libavformat/asf.c @@ -152,3 +152,20 @@ const AVMetadataConv ff_asf_metadata_conv[] = { // { "Year" , "date" }, TODO: conversion year<->date { 0 } }; + +int ff_put_str16_nolen(ByteIOContext *s, const char *tag) +{ + const uint8_t *q = tag; + 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; +} |