aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-10-16 09:53:39 +0200
committerAnton Khirnov <anton@khirnov.net>2012-10-16 18:49:59 +0200
commita119c64e38bd9bfc5c3c94b70b321619c6fabac9 (patch)
tree710c464bddfc383dfdf6c443e720cb7d0d2ee010
parenta25d912dca9cd553440167e0476c47581359c0fc (diff)
downloadffmpeg-a119c64e38bd9bfc5c3c94b70b321619c6fabac9.tar.gz
avconv: fix disabling auto mappings with -map_metadata
CC: libav-stable@libav.org
-rw-r--r--avconv_opt.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/avconv_opt.c b/avconv_opt.c
index 058d5a3779..79444eb6f3 100644
--- a/avconv_opt.c
+++ b/avconv_opt.c
@@ -326,6 +326,10 @@ static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFor
if (type_in == 'c' || type_out == 'c')
o->metadata_chapters_manual = 1;
+ /* ic is NULL when just disabling automatic mappings */
+ if (!ic)
+ return 0;
+
#define METADATA_CHECK_INDEX(index, nb_elems, desc)\
if ((index) < 0 || (index) >= (nb_elems)) {\
av_log(NULL, AV_LOG_FATAL, "Invalid %s index %d while processing metadata maps.\n",\
@@ -1410,13 +1414,13 @@ loop_end:
char *p;
int in_file_index = strtol(o->metadata_map[i].u.str, &p, 0);
- if (in_file_index < 0)
- continue;
if (in_file_index >= nb_input_files) {
av_log(NULL, AV_LOG_FATAL, "Invalid input file index %d while processing metadata maps\n", in_file_index);
exit(1);
}
- copy_metadata(o->metadata_map[i].specifier, *p ? p + 1 : p, oc, input_files[in_file_index]->ctx, o);
+ copy_metadata(o->metadata_map[i].specifier, *p ? p + 1 : p, oc,
+ in_file_index >= 0 ?
+ input_files[in_file_index]->ctx : NULL, o);
}
/* copy chapters */