Commit 07b7b06d authored by Baptiste Coudurier's avatar Baptiste Coudurier

move utf8 code before udta func, will be used by 3gp tags

Originally committed as revision 13745 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent c55cc074
...@@ -1189,6 +1189,33 @@ static int mov_write_meta_tag(ByteIOContext *pb, MOVContext *mov, ...@@ -1189,6 +1189,33 @@ static int mov_write_meta_tag(ByteIOContext *pb, MOVContext *mov,
return size; return size;
} }
static int utf8len(const uint8_t *b)
{
int len=0;
int val;
while(*b){
GET_UTF8(val, *b++, return -1;)
len++;
}
return len;
}
static int ascii_to_wc(ByteIOContext *pb, const uint8_t *b)
{
int val;
while(*b){
GET_UTF8(val, *b++, return -1;)
put_be16(pb, val);
}
put_be16(pb, 0x00);
return 0;
}
static uint16_t language_code(const char *str)
{
return (((str[0]-0x60) & 0x1F) << 10) + (((str[1]-0x60) & 0x1F) << 5) + ((str[2]-0x60) & 0x1F);
}
static int mov_write_udta_tag(ByteIOContext *pb, MOVContext *mov, static int mov_write_udta_tag(ByteIOContext *pb, MOVContext *mov,
AVFormatContext *s) AVFormatContext *s)
{ {
...@@ -1227,33 +1254,6 @@ static int mov_write_udta_tag(ByteIOContext *pb, MOVContext *mov, ...@@ -1227,33 +1254,6 @@ static int mov_write_udta_tag(ByteIOContext *pb, MOVContext *mov,
return 0; return 0;
} }
static int utf8len(const uint8_t *b)
{
int len=0;
int val;
while(*b){
GET_UTF8(val, *b++, return -1;)
len++;
}
return len;
}
static int ascii_to_wc(ByteIOContext *pb, const uint8_t *b)
{
int val;
while(*b){
GET_UTF8(val, *b++, return -1;)
put_be16(pb, val);
}
put_be16(pb, 0x00);
return 0;
}
static uint16_t language_code(const char *str)
{
return (((str[0]-0x60) & 0x1F) << 10) + (((str[1]-0x60) & 0x1F) << 5) + ((str[2]-0x60) & 0x1F);
}
static void mov_write_psp_udta_tag(ByteIOContext *pb, static void mov_write_psp_udta_tag(ByteIOContext *pb,
const char *str, const char *lang, int type) const char *str, const char *lang, int type)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment