45 size_t format_tag_size,
const char **ptr) {
52 }
else if (
av_strstart(identifier,
"$RepresentationID$", &next_ptr)) {
61 else if (
av_strstart(identifier,
"$Bandwidth", &next_ptr))
63 else if (
av_strstart(identifier,
"$Time", &next_ptr))
72 if (next_ptr[0] ==
'$') {
73 snprintf(format_tag, format_tag_size,
"%%%s", number_format);
76 const char *width_ptr;
82 snprintf(format_tag, format_tag_size,
"%s%c%s",
"%0", width_ptr[0], number_format);
86 "closing '$' character or a format-string like '%%0[width]d', "
87 "where width must be a single digit\n", next_ptr);
97 const char *
template,
int rep_id,
98 int number,
int bit_rate,
101 const char *t_cur =
template;
102 while (dst_pos < buffer_size - 1 && *t_cur) {
106 const char *t_next = strchr(t_cur,
'$');
108 int num_copy_bytes =
FFMIN(t_next - t_cur, buffer_size - dst_pos - 1);
109 av_strlcpy(&dst[dst_pos], t_cur, num_copy_bytes + 1);
111 dst_pos += num_copy_bytes;
114 av_strlcpy(&dst[dst_pos], t_cur, buffer_size - dst_pos);
118 if (dst_pos >= buffer_size - 1 || !*t_cur)
129 n =
snprintf(&dst[dst_pos], buffer_size - dst_pos, format_tag, rep_id);
132 n =
snprintf(&dst[dst_pos], buffer_size - dst_pos, format_tag, number);
135 n =
snprintf(&dst[dst_pos], buffer_size - dst_pos, format_tag, bit_rate);
138 n =
snprintf(&dst[dst_pos], buffer_size - dst_pos, format_tag, time);
152 dst_pos +=
FFMIN(
n, buffer_size - dst_pos - 1);