avconv: use correct index when selecting metadata to write to.
authorAnton Khirnov <anton@khirnov.net>
Mon, 5 Sep 2011 12:12:28 +0000 (14:12 +0200)
committerAnton Khirnov <anton@khirnov.net>
Sun, 11 Sep 2011 15:30:05 +0000 (17:30 +0200)
avconv.c

index 471ed00..74120c8 100644 (file)
--- a/avconv.c
+++ b/avconv.c
@@ -3571,14 +3571,14 @@ static void opt_output_file(void *optctx, const char *filename)
                 av_log(NULL, AV_LOG_ERROR, "Invalid stream index %d in metadata specifier.\n", index);
                 exit_program(1);
             }
-            m = &oc->streams[i]->metadata;
+            m = &oc->streams[index]->metadata;
             break;
         case 'c':
             if (index < 0 || index >= oc->nb_chapters) {
                 av_log(NULL, AV_LOG_ERROR, "Invalid chapter index %d in metadata specifier.\n", index);
                 exit_program(1);
             }
-            m = &oc->chapters[i]->metadata;
+            m = &oc->chapters[index]->metadata;
             break;
         default:
             av_log(NULL, AV_LOG_ERROR, "Invalid metadata specifier %s.\n", o->metadata[i].specifier);