aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas George <george@nsup.org>2021-08-31 19:56:24 +0200
committerNicolas George <george@nsup.org>2021-09-16 10:17:59 +0200
commit7517777d06c2f0790692c3e8bb6000239665fd37 (patch)
tree3502b48f20d70defa651bc959b131623c0c61a29
parent74ab93fa7f68ec5aaff923ff10fddc3f529e2d4a (diff)
downloadffmpeg-7517777d06c2f0790692c3e8bb6000239665fd37.tar.gz
lavf/concat: add file_packet_meta directive
Same as file_packet_metadata without the double parsing.
-rw-r--r--doc/demuxers.texi5
-rw-r--r--libavformat/concatdec.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index eb3351833a..f338700396 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -151,6 +151,11 @@ Metadata of the packets of the file. The specified metadata will be set for
each file packet. You can specify this directive multiple times to add multiple
metadata entries.
+@item @code{file_packet_meta @var{key} @var{value}}
+Metadata of the packets of the file. The specified metadata will be set for
+each file packet. You can specify this directive multiple times to add multiple
+metadata entries.
+
@item @code{option @var{key} @var{value}}
Option to access, open and probe the file.
Can be present multiple times.
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index f63b5f0f22..cb6e1b58e7 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -425,6 +425,7 @@ typedef enum ParseDirective {
DIR_DURATION,
DIR_INPOINT,
DIR_OUTPOINT,
+ DIR_FPMETA,
DIR_FPMETAS,
DIR_OPTION,
DIR_STREAM,
@@ -437,6 +438,7 @@ static const ParseSyntax syntax[] = {
[DIR_DURATION ] = { "duration", "d", NEEDS_FILE },
[DIR_INPOINT ] = { "inpoint", "d", NEEDS_FILE },
[DIR_OUTPOINT ] = { "outpoint", "d", NEEDS_FILE },
+ [DIR_FPMETA ] = { "file_packet_meta", "ks", NEEDS_FILE },
[DIR_FPMETAS ] = { "file_packet_metadata", "s", NEEDS_FILE },
[DIR_OPTION ] = { "option", "ks", NEEDS_FILE | NEEDS_UNSAFE },
[DIR_STREAM ] = { "stream", "", 0 },
@@ -550,6 +552,13 @@ static int concat_parse_script(AVFormatContext *avf)
file->outpoint = arg_int[0];
break;
+ case DIR_FPMETA:
+ ret = av_dict_set(&file->metadata, arg_kw[0], arg_str[1], AV_DICT_DONT_STRDUP_VAL);
+ arg_str[1] = NULL;
+ if (ret < 0)
+ FAIL(ret);
+ break;
+
case DIR_FPMETAS:
if ((ret = av_dict_parse_string(&file->metadata, arg_str[0], "=", "", 0)) < 0) {
av_log(avf, AV_LOG_ERROR, "Line %d: failed to parse metadata string\n", line);