[FFmpeg-cvslog] ffmpeg_opt: Allow -metadata option to set metadata on programs.

Vittorio Gambaletta VittGam git at videolan.org
Tue Jan 26 17:36:55 CET 2016


ffmpeg | branch: master | Vittorio Gambaletta (VittGam) <ffmpeg-dev at vittgam.net> | Tue Jan 26 15:13:09 2016 +0100| [74658a8b4db3a0b99e1461283d358f800e93f73a] | committer: Michael Niedermayer

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

Signed-off-by: Vittorio Gambaletta <ffmpeg-dev at vittgam.net>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=74658a8b4db3a0b99e1461283d358f800e93f73a
---

 doc/ffmpeg.texi |    4 ++--
 ffmpeg_opt.c    |    7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index a38a32e..7d3266a 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -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.
 
 An optional @var{metadata_specifier} may be given to set metadata
-on streams or chapters. See @code{-map_metadata} documentation for
-details.
+on streams, chapters or programs. See @code{-map_metadata}
+documentation for details.
 
 This option overrides metadata set with @code{-map_metadata}. It is
 also possible to delete metadata by using an empty value.
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index e03ad89..669976b 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -2466,6 +2466,13 @@ loop_end:
                 }
                 m = &oc->chapters[index]->metadata;
                 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:
                 av_log(NULL, AV_LOG_FATAL, "Invalid metadata specifier %s.\n", o->metadata[i].specifier);
                 exit_program(1);



More information about the ffmpeg-cvslog mailing list