From 852e0ca555514eb103a662df4f104cd596ed7cdf Mon Sep 17 00:00:00 2001 From: Zhentan Feng Date: Wed, 24 Mar 2010 18:40:43 +0000 Subject: 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 . Originally committed as revision 22656 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/asf.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libavformat/asf.c') diff --git a/libavformat/asf.c b/libavformat/asf.c index 20bfd8d..ea577cb 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; +} -- cgit v1.1