Commit 74658a8b authored by Vittorio Gambaletta (VittGam)'s avatar Vittorio Gambaletta (VittGam) Committed by Michael Niedermayer

ffmpeg_opt: Allow -metadata option to set metadata on programs.

Signed-off-by: 's avatarVittorio Gambaletta <ffmpeg-dev@vittgam.net>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 6e448fb9
...@@ -339,8 +339,8 @@ see @ref{date syntax,,the Date section in the ffmpeg-utils(1) manual,ffmpeg-util ...@@ -339,8 +339,8 @@ see @ref{date syntax,,the Date section in the ffmpeg-utils(1) manual,ffmpeg-util
Set a metadata key/value pair. Set a metadata key/value pair.
An optional @var{metadata_specifier} may be given to set metadata An optional @var{metadata_specifier} may be given to set metadata
on streams or chapters. See @code{-map_metadata} documentation for on streams, chapters or programs. See @code{-map_metadata}
details. documentation for details.
This option overrides metadata set with @code{-map_metadata}. It is This option overrides metadata set with @code{-map_metadata}. It is
also possible to delete metadata by using an empty value. also possible to delete metadata by using an empty value.
......
...@@ -2466,6 +2466,13 @@ loop_end: ...@@ -2466,6 +2466,13 @@ loop_end:
} }
m = &oc->chapters[index]->metadata; m = &oc->chapters[index]->metadata;
break; break;
case 'p':
if (index < 0 || index >= oc->nb_programs) {
av_log(NULL, AV_LOG_FATAL, "Invalid program index %d in metadata specifier.\n", index);
exit_program(1);
}
m = &oc->programs[index]->metadata;
break;
default: default:
av_log(NULL, AV_LOG_FATAL, "Invalid metadata specifier %s.\n", o->metadata[i].specifier); av_log(NULL, AV_LOG_FATAL, "Invalid metadata specifier %s.\n", o->metadata[i].specifier);
exit_program(1); exit_program(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment