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);
110 dst_pos += num_copy_bytes;
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);
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static DASHTmplId dash_read_tmpl_id(const char *identifier, char *format_tag, size_t format_tag_size, const char **ptr)
void ff_dash_fill_tmpl_params(char *dst, size_t buffer_size, const char *template, int rep_id, int number, int bit_rate, int64_t time)
#define AV_LOG_WARNING
Something somehow does not look correct.
static av_const int av_isdigit(int c)
Locale-independent conversion of ASCII isdigit.
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
miscellaneous OS support macros and functions.
Utilities for rational number calculation.
unbuffered private I/O API