@@ -96,8 +96,7 @@ backslash or single quotes.
All subsequent file-related directives apply to that file.
@item @code{ffconcat version 1.0}
-Identify the script type and version. It also sets the @option{safe} option
-to 1 if it was -1.
+Identify the script type and version.
To make FFmpeg recognize the format automatically, this directive must
appear exactly as is (no extra space or byte-order-mark) on the very first
@@ -177,7 +176,8 @@ This demuxer accepts the following option:
@table @option
@item safe
-If set to 1, reject unsafe file paths. A file path is considered safe if it
+If set to 1, reject unsafe file paths and directives.
+A file path is considered safe if it
does not contain a protocol specification and is relative and all components
only contain characters from the portable character set (letters, digits,
period, underscore and hyphen) and have no period at the beginning of a
@@ -187,9 +187,6 @@ If set to 0, any file name is accepted.
The default is 1.
--1 is equivalent to 1 if the format was automatically
-probed and 0 otherwise.
-
@item auto_convert
If set to 1, try to perform automatic conversions on packet data to make the
streams concatenable.
@@ -118,7 +118,7 @@ static int add_file(AVFormatContext *avf, char *filename, ConcatFile **rfile,
size_t url_len;
int ret;
- if (cat->safe > 0 && !safe_filename(filename)) {
+ if (cat->safe && !safe_filename(filename)) {
av_log(avf, AV_LOG_ERROR, "Unsafe file name '%s'\n", filename);
FAIL(AVERROR(EPERM));
}
@@ -476,8 +476,6 @@ static int concat_read_header(AVFormatContext *avf)
av_log(avf, AV_LOG_ERROR, "Line %d: invalid version\n", line);
FAIL(AVERROR_INVALIDDATA);
}
- if (cat->safe < 0)
- cat->safe = 1;
} else {
av_log(avf, AV_LOG_ERROR, "Line %d: unknown keyword '%s'\n",
line, keyword);
@@ -757,7 +755,7 @@ static int concat_seek(AVFormatContext *avf, int stream,
static const AVOption options[] = {
{ "safe", "enable safe mode",
- OFFSET(safe), AV_OPT_TYPE_BOOL, {.i64 = 1}, -1, 1, DEC },
+ OFFSET(safe), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, DEC },
{ "auto_convert", "automatically convert bitstream format",
OFFSET(auto_convert), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, DEC },
{ "segment_time_metadata", "output file segment start time and duration as packet metadata",
It only makes sense as the default value, but it is not the default since 689211d5727231c3fe92762d224dbadebdbf4e30. Signed-off-by: Nicolas George <george@nsup.org> --- doc/demuxers.texi | 9 +++------ libavformat/concatdec.c | 6 ++---- 2 files changed, 5 insertions(+), 10 deletions(-) Second patch updated with Andrea's comments. Final patch removing the in-protocol option syntax withdrawn for now. Other patches unchanged. Will push soon.