Mercurial > libavformat.hg
diff asf.c @ 5876:2c0f0162a110 libavformat
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>.
author | rbultje |
---|---|
date | Wed, 24 Mar 2010 18:40:43 +0000 |
parents | e3ec6991698b |
children | 8866437e389a |
line wrap: on
line diff
--- a/asf.c Wed Mar 24 11:11:25 2010 +0000 +++ b/asf.c Wed Mar 24 18:40:43 2010 +0000 @@ -152,3 +152,20 @@ // { "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; +}