aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-10-25 21:27:41 +0200
committerNicolas George <nicolas.george@normalesup.org>2012-10-28 09:14:34 +0100
commitb0e2f4a757d6f331d3b54847ffc663e04922f558 (patch)
tree83d2f73429ef9aea780bff5e8aad4915b04ed8b1
parentc4a36b6f70f37e668874d134f955eb96e23853c9 (diff)
downloadffmpeg-b0e2f4a757d6f331d3b54847ffc663e04922f558.tar.gz
lavfi/concat: implement unsafe mode.
-rw-r--r--doc/filters.texi3
-rw-r--r--libavfilter/avf_concat.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/doc/filters.texi b/doc/filters.texi
index c4e29c30f1..19b8bf2229 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -4643,6 +4643,9 @@ streams in each segment. Default is 1.
Set the number of output audio streams, that is also the number of video
streams in each segment. Default is 0.
+@item unsafe
+Activate unsafe mode: do not fail if segments have a different format.
+
@end table
The filter has @var{v}+@var{a} outputs: first @var{v} video outputs, then
diff --git a/libavfilter/avf_concat.c b/libavfilter/avf_concat.c
index b3aed3ccde..f13e8d0120 100644
--- a/libavfilter/avf_concat.c
+++ b/libavfilter/avf_concat.c
@@ -42,6 +42,7 @@ typedef struct {
unsigned cur_idx; /**< index of the first input of current segment */
int64_t delta_ts; /**< timestamp to add to produce output timestamps */
unsigned nb_in_active; /**< number of active inputs in current segment */
+ unsigned unsafe;
struct concat_in {
int64_t pts;
int64_t nb_frames;
@@ -64,6 +65,9 @@ static const AVOption concat_options[] = {
{ "a", "specify the number of audio streams",
OFFSET(nb_streams[AVMEDIA_TYPE_AUDIO]),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, A|F},
+ { "unsafe", "enable unsafe mode",
+ OFFSET(unsafe),
+ AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, A|A|F},
{ 0 }
};
@@ -143,7 +147,8 @@ static int config_output(AVFilterLink *outlink)
ctx->input_pads[out_no].name, outlink->w, outlink->h,
outlink->sample_aspect_ratio.num,
outlink->sample_aspect_ratio.den);
- return AVERROR(EINVAL);
+ if (!cat->unsafe)
+ return AVERROR(EINVAL);
}
}