31 #define FF_BUFQUEUE_SIZE 256
55 #define OFFSET(x) offsetof(ConcatContext, x)
56 #define A AV_OPT_FLAG_AUDIO_PARAM
57 #define F AV_OPT_FLAG_FILTERING_PARAM
58 #define V AV_OPT_FLAG_VIDEO_PARAM
61 {
"n",
"specify the number of segments",
OFFSET(nb_segments),
63 {
"v",
"specify the number of video streams",
66 {
"a",
"specify the number of audio streams",
69 {
"unsafe",
"enable unsafe mode",
80 unsigned type, nb_str, idx0 = 0, idx, str, seg;
84 for (type = 0; type <
TYPE_ALL; type++) {
86 for (str = 0; str < nb_str; str++) {
126 unsigned in_no = out_no, seg;
131 outlink->
w = inlink->
w;
132 outlink->
h = inlink->
h;
138 if (outlink->
w != inlink->
w ||
139 outlink->
h != inlink->
h ||
143 "(size %dx%d, SAR %d:%d) do not match the corresponding "
144 "output link %s parameters (%dx%d, SAR %d:%d)\n",
166 struct concat_in *in = &cat->
in[in_no];
177 else if (in->nb_frames >= 2)
179 in->pts =
av_rescale(in->pts, in->nb_frames, in->nb_frames - 1);
181 buf->pts += cat->delta_ts;
191 if (in_no < cat->cur_idx) {
232 cat->
in[in_no].
eof = 1;
245 pts = cat->
in[i++].
pts;
246 for (; i < imax; i++)
257 int frame_nb_samples;
266 frame_nb_samples =
FFMAX(9600, rate_tb.
den / 5);
268 frame_nb_samples =
FFMIN(frame_nb_samples, nb_samples);
273 nb_channels, outlink->
format);
276 sent += frame_nb_samples;
277 nb_samples -= frame_nb_samples;
284 unsigned str, str_max;
296 for (; str < str_max; str++)
301 for (str = cat->
cur_idx; str < str_max; str++)
312 unsigned in_no = out_no + cat->
cur_idx;
313 unsigned str, str_max;
319 if (!cat->
in[in_no].
eof) {
329 str = str == str_max ? cat->
cur_idx : str + 1) {
330 if (cat->
in[str].
eof)
347 unsigned seg, type, str;
349 cat->
class = &concat_class;
359 for (type = 0; type <
TYPE_ALL; type++) {
360 for (str = 0; str < cat->
nb_streams[type]; str++) {
374 for (type = 0; type <
TYPE_ALL; type++) {
375 for (str = 0; str < cat->
nb_streams[type]; str++) {
416 .priv_class = &concat_class,