]> git.sesse.net Git - ffmpeg/commitdiff
lavf/concatdec: add signature directive.
authorNicolas George <nicolas.george@normalesup.org>
Sun, 3 Feb 2013 09:22:57 +0000 (10:22 +0100)
committerNicolas George <nicolas.george@normalesup.org>
Wed, 13 Feb 2013 13:58:50 +0000 (14:58 +0100)
doc/demuxers.texi
libavformat/concatdec.c

index 2a6f7790fc97012209af949d8e5c8671c914032b..2867538860d3995ba0410c95130e3ae5260eb193 100644 (file)
@@ -58,6 +58,10 @@ following directive is recognized:
 Path to a file to read; special characters and spaces must be escaped with
 backslash or single quotes.
 
+@item @code{ffconcat version 1.0}
+Identify the script type and version. It also sets the @option{safe} option
+to 1 if it was to its default -1.
+
 @end table
 
 @subsection Options
index bba99d8e669dc5a7a050a6d7b40ee583d70ebe4e..b99ec5c15c76d965177044c355b38026a5e3cc92 100644 (file)
@@ -173,6 +173,15 @@ static int concat_read_header(AVFormatContext *avf)
             }
             if ((ret = add_file(avf, filename, &file, &nb_files_alloc)) < 0)
                 FAIL(ret);
+        } else if (!strcmp(keyword, "ffconcat")) {
+            char *ver_kw  = get_keyword(&cursor);
+            char *ver_val = get_keyword(&cursor);
+            if (strcmp(ver_kw, "version") || strcmp(ver_val, "1.0")) {
+                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);