[SCM] libav/experimental: ffmpeg.c: don't autocopy stream/chapter metadata if manual mapping is specified

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:18:27 UTC 2013


The following commit has been merged in the experimental branch:
commit d0abe80aa4297801eab7eb61ac2e98d74681715f
Author: Anton Khirnov <wyskas at gmail.com>
Date:   Tue Nov 2 06:12:54 2010 +0000

    ffmpeg.c: don't autocopy stream/chapter metadata if manual mapping is specified
    
    Originally committed as revision 25636 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/ffmpeg.c b/ffmpeg.c
index 8a6317b..53a1827 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -129,6 +129,8 @@ static int nb_stream_maps;
 /* first item specifies output metadata, second is input */
 static AVMetaDataMap (*meta_data_maps)[2] = NULL;
 static int nb_meta_data_maps;
+static int metadata_streams_autocopy  = 1;
+static int metadata_chapters_autocopy = 1;
 
 /* indexed by output file stream index */
 static int *streamid_map = NULL;
@@ -1860,6 +1862,7 @@ static int copy_chapters(int infile, int outfile)
         out_ch->start     = FFMAX(0,  in_ch->start - ts_off);
         out_ch->end       = FFMIN(rt, in_ch->end   - ts_off);
 
+        if (metadata_chapters_autocopy)
         while ((t = av_metadata_get(in_ch->metadata, "", t, AV_METADATA_IGNORE_SUFFIX)))
             av_metadata_set2(&out_ch->metadata, t->key, t->value, 0);
 
@@ -2089,6 +2092,7 @@ static int transcode(AVFormatContext **output_files,
         codec = ost->st->codec;
         icodec = ist->st->codec;
 
+        if (metadata_streams_autocopy)
         while ((t = av_metadata_get(ist->st->metadata, "", t, AV_METADATA_IGNORE_SUFFIX))) {
             av_metadata_set2(&ost->st->metadata, t->key, t->value, AV_METADATA_DONT_OVERWRITE);
         }
@@ -2950,6 +2954,11 @@ static void opt_map_meta_data(const char *arg)
     m1 = &meta_data_maps[nb_meta_data_maps - 1][1];
     m1->file = strtol(p, &p, 0);
     parse_meta_type(p, &m1->type, &m1->index, &p);
+
+    if (m->type == 's' || m1->type == 's')
+        metadata_streams_autocopy = 0;
+    if (m->type == 'c' || m1->type == 'c')
+        metadata_chapters_autocopy = 0;
 }
 
 static void opt_input_ts_scale(const char *arg)

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list