mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
simplify
Originally committed as revision 13743 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
20e22af85a
commit
d32d6defee
@ -1254,26 +1254,23 @@ static uint16_t language_code(const char *str)
|
|||||||
return (((str[0]-0x60) & 0x1F) << 10) + (((str[1]-0x60) & 0x1F) << 5) + ((str[2]-0x60) & 0x1F);
|
return (((str[0]-0x60) & 0x1F) << 10) + (((str[1]-0x60) & 0x1F) << 5) + ((str[2]-0x60) & 0x1F);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int 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)
|
||||||
{
|
{
|
||||||
int len = utf8len(str)+1;
|
int len = utf8len(str)+1;
|
||||||
if(len<=0)
|
if(len<=0)
|
||||||
return 0;
|
return;
|
||||||
put_be16(pb, len*2+10); /* size */
|
put_be16(pb, len*2+10); /* size */
|
||||||
put_be32(pb, type); /* type */
|
put_be32(pb, type); /* type */
|
||||||
put_be16(pb, language_code(lang)); /* language */
|
put_be16(pb, language_code(lang)); /* language */
|
||||||
put_be16(pb, 0x01); /* ? */
|
put_be16(pb, 0x01); /* ? */
|
||||||
ascii_to_wc(pb, str);
|
ascii_to_wc(pb, str);
|
||||||
return len*2+10;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mov_write_uuidusmt_tag(ByteIOContext *pb, AVFormatContext *s)
|
static int mov_write_uuidusmt_tag(ByteIOContext *pb, AVFormatContext *s)
|
||||||
{
|
{
|
||||||
size_t size;
|
offset_t pos, pos2;
|
||||||
offset_t pos, curpos;
|
|
||||||
|
|
||||||
size = 0;
|
|
||||||
if (s->title[0]) {
|
if (s->title[0]) {
|
||||||
pos = url_ftell(pb);
|
pos = url_ftell(pb);
|
||||||
put_be32(pb, 0); /* size placeholder*/
|
put_be32(pb, 0); /* size placeholder*/
|
||||||
@ -1282,12 +1279,11 @@ static int mov_write_uuidusmt_tag(ByteIOContext *pb, AVFormatContext *s)
|
|||||||
put_be32(pb, 0x21d24fce); /* 96 bit UUID */
|
put_be32(pb, 0x21d24fce); /* 96 bit UUID */
|
||||||
put_be32(pb, 0xbb88695c);
|
put_be32(pb, 0xbb88695c);
|
||||||
put_be32(pb, 0xfac9c740);
|
put_be32(pb, 0xfac9c740);
|
||||||
size += 24;
|
|
||||||
|
|
||||||
|
pos2 = url_ftell(pb);
|
||||||
put_be32(pb, 0); /* size placeholder*/
|
put_be32(pb, 0); /* size placeholder*/
|
||||||
put_tag(pb, "MTDT");
|
put_tag(pb, "MTDT");
|
||||||
put_be16(pb, 4);
|
put_be16(pb, 4);
|
||||||
size += 10;
|
|
||||||
|
|
||||||
// ?
|
// ?
|
||||||
put_be16(pb, 0x0C); /* size */
|
put_be16(pb, 0x0C); /* size */
|
||||||
@ -1295,23 +1291,17 @@ static int mov_write_uuidusmt_tag(ByteIOContext *pb, AVFormatContext *s)
|
|||||||
put_be16(pb, language_code("und")); /* language */
|
put_be16(pb, language_code("und")); /* language */
|
||||||
put_be16(pb, 0x0); /* ? */
|
put_be16(pb, 0x0); /* ? */
|
||||||
put_be16(pb, 0x021C); /* data */
|
put_be16(pb, 0x021C); /* data */
|
||||||
size += 12;
|
|
||||||
|
|
||||||
size += mov_write_psp_udta_tag(pb, LIBAVCODEC_IDENT, "eng", 0x04);
|
mov_write_psp_udta_tag(pb, LIBAVCODEC_IDENT, "eng", 0x04);
|
||||||
size += mov_write_psp_udta_tag(pb, s->title, "eng", 0x01);
|
mov_write_psp_udta_tag(pb, s->title, "eng", 0x01);
|
||||||
// snprintf(dt,32,"%04d/%02d/%02d %02d:%02d:%02d",t_st->tm_year+1900,t_st->tm_mon+1,t_st->tm_mday,t_st->tm_hour,t_st->tm_min,t_st->tm_sec);
|
// snprintf(dt,32,"%04d/%02d/%02d %02d:%02d:%02d",t_st->tm_year+1900,t_st->tm_mon+1,t_st->tm_mday,t_st->tm_hour,t_st->tm_min,t_st->tm_sec);
|
||||||
size += mov_write_psp_udta_tag(pb, "2006/04/01 11:11:11", "und", 0x03);
|
mov_write_psp_udta_tag(pb, "2006/04/01 11:11:11", "und", 0x03);
|
||||||
|
|
||||||
// size
|
updateSize(pb, pos2);
|
||||||
curpos = url_ftell(pb);
|
return updateSize(pb, pos);
|
||||||
url_fseek(pb, pos, SEEK_SET);
|
|
||||||
put_be32(pb, size);
|
|
||||||
url_fseek(pb, pos+24, SEEK_SET);
|
|
||||||
put_be32(pb, size-24);
|
|
||||||
url_fseek(pb, curpos, SEEK_SET);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return size;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mov_write_moov_tag(ByteIOContext *pb, MOVContext *mov,
|
static int mov_write_moov_tag(ByteIOContext *pb, MOVContext *mov,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user