46 return memcmp(probe->
buf,
"ffconcat version 1.0", 20) ?
63 const char *
start = f;
67 if (!((
unsigned)((*f | 32) -
'a') < 26 ||
68 (
unsigned)(*f -
'0') < 10 || *f ==
'_' || *f ==
'-')) {
80 #define FAIL(retcode) do { ret = (retcode); goto fail; } while(0)
83 unsigned *nb_files_alloc)
95 url_len = strlen(avf->
filename) + strlen(filename) + 16;
101 if (cat->
nb_files >= *nb_files_alloc) {
102 size_t n =
FFMAX(*nb_files_alloc * 2, 16);
104 if (n <= cat->nb_files || n > SIZE_MAX /
sizeof(*cat->
files) ||
107 cat->
files = new_files;
112 memset(file, 0,
sizeof(*file));
174 unsigned nb_files_alloc = 0;
185 if (!*keyword || *keyword ==
'#')
188 if (!strcmp(keyword,
"file")) {
194 if ((ret =
add_file(avf, filename, &file, &nb_files_alloc)) < 0)
196 }
else if (!strcmp(keyword,
"duration")) {
210 }
else if (!strcmp(keyword,
"ffconcat")) {
213 if (strcmp(ver_kw,
"version") || strcmp(ver_val,
"1.0")) {
230 for (i = 0; i < cat->
nb_files; i++) {
303 int64_t *min_ts, int64_t *ts, int64_t *max_ts)
313 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
319 min_ts = min_ts == INT64_MIN ? INT64_MIN : min_ts -
t0;
320 max_ts = max_ts == INT64_MAX ? INT64_MAX : max_ts -
t0;
325 &min_ts, &ts, &max_ts);
331 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
334 int ret, left, right;
340 &min_ts, &ts, &max_ts);
345 while (right - left > 1) {
346 int mid = (left + right) / 2;
356 ret =
try_seek(avf, stream, min_ts, ts, max_ts, flags);
358 left < cat->nb_files - 1 &&
360 if ((ret =
open_file(avf, left + 1)) < 0)
362 ret =
try_seek(avf, stream, min_ts, ts, max_ts, flags);
368 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
380 if ((ret =
real_seek(avf, stream, min_ts, ts, max_ts, flags)) < 0) {
383 cat->
avf = cur_avf_saved;
391 #define OFFSET(x) offsetof(ConcatContext, x)
392 #define DEC AV_OPT_FLAG_DECODING_PARAM
395 {
"safe",
"enable safe mode",
417 .priv_class = &concat_class,