50 #define OFFSET(x) offsetof(AMergeContext, x)
51 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
54 {
"inputs",
"specify the number of inputs",
OFFSET(nb_inputs),
81 int i, overlap = 0, nb_ch = 0;
87 "No channel layout for input %d\n", i + 1);
97 if (outlayout & inlayout[i])
99 outlayout |= inlayout[i];
108 "Input channel layouts overlap: "
109 "output layout will be determined by the number of distinct input channels\n");
110 for (i = 0; i < nb_ch; i++)
114 outlayout = ((int64_t)1 << nb_ch) - 1;
117 int c, out_ch_number = 0;
119 route[0] = am->
route;
121 route[i] = route[i - 1] + am->
in[i - 1].
nb_ch;
122 for (c = 0; c < 64; c++)
124 if ((inlayout[i] >> c) & 1)
125 *(route[i]++) = out_ch_number++;
151 "Inputs must have the same sample rate "
152 "%d for in%d vs %d\n",
163 av_bprintf(&bp,
"%sin%d:", i ?
" + " :
"", i);
209 for (i = 0; i < nb_inputs; i++)
210 nb_ch += in[i].nb_ch;
213 for (i = 0; i < nb_inputs; i++) {
214 for (c = 0; c < in[i].nb_ch; c++) {
215 memcpy((*outs) + bps * *(route_cur++), ins[i], bps);
219 *outs += nb_ch *
bps;
229 int nb_samples, ns, i;
233 for (input_number = 0; input_number < am->
nb_inputs; input_number++)
234 if (inlink == ctx->
inputs[input_number])
253 outs = outbuf->
data[0];
256 ins[i] = inbuf[i]->
data[0] +
273 ns =
FFMIN(ns, inbuf[i]->nb_samples - am->
in[i].
pos);
300 ins[i] = inbuf[i] ? inbuf[i]->
data[0] : NULL;
342 "a single multi-channel stream."),
349 .priv_class = &amerge_class,