44 size_t format_tag_size,
const char **ptr) {
51 }
else if (
av_strstart(identifier,
"$RepresentationID$", &next_ptr)) {
60 else if (
av_strstart(identifier,
"$Bandwidth", &next_ptr))
62 else if (
av_strstart(identifier,
"$Time", &next_ptr))
71 if (next_ptr[0] ==
'$') {
72 snprintf(format_tag, format_tag_size,
"%%%s", number_format);
75 const char *width_ptr;
81 snprintf(format_tag, format_tag_size,
"%s%c%s",
"%0", width_ptr[0], number_format);
85 "closing '$' character or a format-string like '%%0[width]d', "
86 "where width must be a single digit\n", next_ptr);
96 const char *
template,
int rep_id,
97 int number,
int bit_rate,
100 const char *t_cur =
template;
101 while (dst_pos < buffer_size - 1 && *t_cur) {
105 const char *t_next = strchr(t_cur,
'$');
107 int num_copy_bytes =
FFMIN(t_next - t_cur, buffer_size - dst_pos - 1);
108 av_strlcpy(&dst[dst_pos], t_cur, num_copy_bytes + 1);
110 dst_pos += num_copy_bytes;
113 av_strlcpy(&dst[dst_pos], t_cur, buffer_size - dst_pos);
117 if (dst_pos >= buffer_size - 1 || !*t_cur)
128 n =
snprintf(&dst[dst_pos], buffer_size - dst_pos, format_tag, rep_id);
131 n =
snprintf(&dst[dst_pos], buffer_size - dst_pos, format_tag, number);
134 n =
snprintf(&dst[dst_pos], buffer_size - dst_pos, format_tag, bit_rate);
137 n =
snprintf(&dst[dst_pos], buffer_size - dst_pos, format_tag, time);
151 dst_pos +=
FFMIN(n, buffer_size - dst_pos - 1);