} ConcatContext;
#define OFFSET(x) offsetof(ConcatContext, x)
+#define A AV_OPT_FLAG_AUDIO_PARAM
+#define F AV_OPT_FLAG_FILTERING_PARAM
+#define V AV_OPT_FLAG_VIDEO_PARAM
static const AVOption concat_options[] = {
{ "n", "specify the number of segments", OFFSET(nb_segments),
- AV_OPT_TYPE_INT, { .dbl = 2 }, 2, INT_MAX },
+ AV_OPT_TYPE_INT, { .dbl = 2 }, 2, INT_MAX, V|A|F},
{ "v", "specify the number of video streams",
OFFSET(nb_streams[AVMEDIA_TYPE_VIDEO]),
- AV_OPT_TYPE_INT, { .dbl = 1 }, 1, INT_MAX },
+ AV_OPT_TYPE_INT, { .dbl = 1 }, 0, INT_MAX, V|F },
{ "a", "specify the number of audio streams",
OFFSET(nb_streams[AVMEDIA_TYPE_AUDIO]),
- AV_OPT_TYPE_INT, { .dbl = 0 }, 0, INT_MAX },
+ AV_OPT_TYPE_INT, { .dbl = 0 }, 0, INT_MAX, A|F},
{ 0 }
};
{
ConcatContext *cat = ctx->priv;
AVFilterLink *outlink = ctx->outputs[out_no];
- int64_t base_pts = cat->in[in_no].pts;
+ int64_t base_pts = cat->in[in_no].pts + cat->delta_ts;
int64_t nb_samples, sent = 0;
int frame_nb_samples;
AVRational rate_tb = { 1, ctx->inputs[in_no]->sample_rate };
for (str = 0; str < cat->nb_streams[type]; str++) {
AVFilterPad pad = {
.type = type,
- .min_perms = AV_PERM_READ,
- .rej_perms = AV_PERM_REUSE2,
+ .min_perms = AV_PERM_READ | AV_PERM_PRESERVE,
.get_video_buffer = get_video_buffer,
.get_audio_buffer = get_audio_buffer,
};
.priv_size = sizeof(ConcatContext),
.inputs = (const AVFilterPad[]) { { .name = NULL } },
.outputs = (const AVFilterPad[]) { { .name = NULL } },
+ .priv_class = &concat_class,
};