34 {
"ALBUMARTIST",
"album_artist"},
35 {
"TRACKNUMBER",
"track" },
36 {
"DISCNUMBER",
"disc" },
37 {
"DESCRIPTION",
"comment" },
42 AVChapter **chapters,
unsigned int nb_chapters)
45 len += strlen(vendor_string);
46 if (chapters && nb_chapters) {
47 for (
int i = 0;
i < nb_chapters;
i++) {
49 len += 4 + 12 + 1 + 10;
51 int64_t len1 = !strcmp(tag->
key,
"title") ? 4 : strlen(tag->
key);
52 len += 4 + 10 + len1 + 1 + strlen(tag->
value);
59 len += 4 +strlen(tag->
key) + 1 + strlen(tag->
value);
66 const char *vendor_string,
67 AVChapter **chapters,
unsigned int nb_chapters)
70 bytestream_put_le32(p, strlen(vendor_string));
72 if (chapters && nb_chapters) {
73 for (
int i = 0;
i < nb_chapters;
i++) {
80 bytestream_put_le32(p, count);
82 int64_t len1 = strlen(tag->
key);
83 int64_t len2 = strlen(tag->
value);
84 if (len1+1+len2 > UINT32_MAX)
86 bytestream_put_le32(p, len1+1+len2);
88 bytestream_put_byte(p,
'=');
91 for (
int i = 0;
i < nb_chapters;
i++) {
93 char chapter_time[13];
94 char chapter_number[4];
102 snprintf(chapter_number,
sizeof(chapter_number),
"%03d",
i);
103 snprintf(chapter_time,
sizeof(chapter_time),
"%02d:%02d:%02d.%03d", h, m, s, ms);
104 bytestream_put_le32(p, 10+1+12);
107 bytestream_put_byte(p,
'=');
112 int64_t len1 = !strcmp(tag->
key,
"title") ? 4 : strlen(tag->
key);
113 int64_t len2 = strlen(tag->
value);
114 if (len1+1+len2+10 > UINT32_MAX)
116 bytestream_put_le32(p, 10+len1+1+len2);
119 if (!strcmp(tag->
key,
"title"))
123 bytestream_put_byte(p,
'=');
128 bytestream_put_le32(p, 0);
int av_dict_count(const AVDictionary *m)
Get number of entries in dictionary.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define i(width, name, range_min, range_max)
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
static AVRational av_make_q(int num, int den)
Create an AVRational.
AVRational time_base
time base in which the start/end timestamps are specified
static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key, ignoring the suffix of the found key string.