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",
165 struct concat_in *
in = &cat->
in[in_no];
176 else if (
in->nb_frames >= 2)
180 buf->pts += cat->delta_ts;
190 if (in_no < cat->cur_idx) {
229 cat->
in[in_no].
eof = 1;
242 pts = cat->
in[i++].
pts;
243 for (; i < imax; i++)
254 int64_t base_pts = cat->
in[in_no].
pts + cat->
delta_ts - seg_delta;
255 int64_t nb_samples, sent = 0;
256 int frame_nb_samples,
ret;
265 frame_nb_samples =
FFMAX(9600, rate_tb.
den / 5);
267 frame_nb_samples =
FFMIN(frame_nb_samples, nb_samples);
272 nb_channels, outlink->
format);
277 sent += frame_nb_samples;
278 nb_samples -= frame_nb_samples;
287 unsigned str, str_max;
300 for (; str < str_max; str++) {
309 for (str = cat->
cur_idx; str < str_max; str++) {
325 unsigned in_no = out_no + cat->
cur_idx;
326 unsigned str, str_max;
332 if (!cat->
in[in_no].
eof) {
342 str = str == str_max ? cat->
cur_idx : str + 1) {
343 if (cat->
in[str].
eof)
361 unsigned seg,
type, str;
365 for (type = 0; type <
TYPE_ALL; type++) {
366 for (str = 0; str < cat->
nb_streams[type]; str++) {
379 for (type = 0; type <
TYPE_ALL; type++) {
380 for (str = 0; str < cat->
nb_streams[type]; str++) {