45 return memcmp(probe->
buf,
"ffconcat version 1.0", 20) ?
62 const char *
start = f;
66 if (!((
unsigned)((*f | 32) -
'a') < 26 ||
67 (
unsigned)(*f -
'0') < 10 || *f ==
'_' || *f ==
'-')) {
79 #define FAIL(retcode) do { ret = (retcode); goto fail; } while(0)
82 unsigned *nb_files_alloc)
94 url_len = strlen(avf->
filename) + strlen(filename) + 16;
100 if (cat->
nb_files >= *nb_files_alloc) {
101 size_t n =
FFMAX(*nb_files_alloc * 2, 16);
103 if (n <= cat->nb_files || n > SIZE_MAX /
sizeof(*cat->
files) ||
106 cat->
files = new_files;
111 memset(file, 0,
sizeof(*file));
166 unsigned nb_files_alloc = 0;
177 if (!*keyword || *keyword ==
'#')
180 if (!strcmp(keyword,
"file")) {
186 if ((ret =
add_file(avf, filename, &file, &nb_files_alloc)) < 0)
188 }
else if (!strcmp(keyword,
"duration")) {
202 }
else if (!strcmp(keyword,
"ffconcat")) {
205 if (strcmp(ver_kw,
"version") || strcmp(ver_val,
"1.0")) {
222 for (i = 0; i < cat->
nb_files; i++) {
292 int64_t *min_ts, int64_t *ts, int64_t *max_ts)
302 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
308 min_ts = min_ts == INT64_MIN ? INT64_MIN : min_ts -
t0;
309 max_ts = max_ts == INT64_MAX ? INT64_MAX : max_ts -
t0;
314 &min_ts, &ts, &max_ts);
320 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
323 int ret, left, right;
329 &min_ts, &ts, &max_ts);
334 while (right - left > 1) {
335 int mid = (left + right) / 2;
345 ret =
try_seek(avf, stream, min_ts, ts, max_ts, flags);
347 left < cat->nb_files - 1 &&
349 if ((ret =
open_file(avf, left + 1)) < 0)
351 ret =
try_seek(avf, stream, min_ts, ts, max_ts, flags);
357 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
369 if ((ret =
real_seek(avf, stream, min_ts, ts, max_ts, flags)) < 0) {
372 cat->
avf = cur_avf_saved;
380 #define OFFSET(x) offsetof(ConcatContext, x)
381 #define DEC AV_OPT_FLAG_DECODING_PARAM
384 {
"safe",
"enable safe mode",
406 .priv_class = &concat_class,