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));
167 unsigned nb_files_alloc = 0;
178 if (!*keyword || *keyword ==
'#')
181 if (!strcmp(keyword,
"file")) {
187 if ((ret =
add_file(avf, filename, &file, &nb_files_alloc)) < 0)
189 }
else if (!strcmp(keyword,
"duration")) {
203 }
else if (!strcmp(keyword,
"ffconcat")) {
206 if (strcmp(ver_kw,
"version") || strcmp(ver_val,
"1.0")) {
223 for (i = 0; i < cat->
nb_files; i++) {
293 int64_t *min_ts, int64_t *ts, int64_t *max_ts)
303 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
309 min_ts = min_ts == INT64_MIN ? INT64_MIN : min_ts -
t0;
310 max_ts = max_ts == INT64_MAX ? INT64_MAX : max_ts -
t0;
315 &min_ts, &ts, &max_ts);
321 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
324 int ret, left, right;
330 &min_ts, &ts, &max_ts);
335 while (right - left > 1) {
336 int mid = (left + right) / 2;
346 ret =
try_seek(avf, stream, min_ts, ts, max_ts, flags);
348 left < cat->nb_files - 1 &&
350 if ((ret =
open_file(avf, left + 1)) < 0)
352 ret =
try_seek(avf, stream, min_ts, ts, max_ts, flags);
358 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
370 if ((ret =
real_seek(avf, stream, min_ts, ts, max_ts, flags)) < 0) {
373 cat->
avf = cur_avf_saved;
381 #define OFFSET(x) offsetof(ConcatContext, x)
382 #define DEC AV_OPT_FLAG_DECODING_PARAM
385 {
"safe",
"enable safe mode",
407 .priv_class = &concat_class,