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;
140 if (outlink->
w != inlink->
w ||
141 outlink->
h != inlink->
h ||
146 "(size %dx%d, SAR %d:%d) do not match the corresponding "
147 "output link %s parameters (%dx%d, SAR %d:%d)\n",
168 struct concat_in *
in = &cat->
in[in_no];
179 else if (
in->nb_frames >= 2)
183 buf->pts += cat->delta_ts;
193 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 int64_t base_pts = cat->
in[in_no].
pts + cat->
delta_ts - seg_delta;
258 int64_t nb_samples, sent = 0;
259 int frame_nb_samples,
ret;
268 frame_nb_samples =
FFMAX(9600, rate_tb.
den / 5);
270 frame_nb_samples =
FFMIN(frame_nb_samples, nb_samples);
275 nb_channels, outlink->
format);
280 sent += frame_nb_samples;
281 nb_samples -= frame_nb_samples;
290 unsigned str, str_max;
303 for (; str < str_max; str++) {
312 for (str = cat->
cur_idx; str < str_max; str++) {
328 unsigned in_no = out_no + cat->
cur_idx;
329 unsigned str, str_max;
335 if (!cat->
in[in_no].
eof) {
345 str = str == str_max ? cat->
cur_idx : str + 1) {
346 if (cat->
in[str].
eof)
364 unsigned seg,
type, str;
368 for (type = 0; type <
TYPE_ALL; type++) {
369 for (str = 0; str < cat->
nb_streams[type]; str++) {
382 for (type = 0; type <
TYPE_ALL; type++) {
383 for (str = 0; str < cat->
nb_streams[type]; str++) {