start counting track number from 0
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Wed, 18 Feb 2009 02:57:41 +0000 (02:57 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Wed, 18 Feb 2009 02:57:41 +0000 (02:57 +0000)
Originally committed as revision 17419 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/mxfenc.c

index d9d8d22..1f09a09 100644 (file)
@@ -1466,15 +1466,13 @@ static int mxf_write_header(AVFormatContext *s)
 
         sc->codec_ul = &mxf_essence_container_uls[sc->index].codec_ul;
 
-        if (!present[sc->index]) {
-            present[sc->index] = 1;
-            mxf->essence_container_count++;
-        } else
-            present[sc->index]++;
-
         memcpy(sc->track_essence_element_key, mxf_essence_container_uls[sc->index].element_ul, 15);
         sc->track_essence_element_key[15] = present[sc->index];
         PRINT_KEY(s, "track essence element key", sc->track_essence_element_key);
+
+        if (!present[sc->index])
+            mxf->essence_container_count++;
+        present[sc->index]++;
     }
 
     if (s->oformat == &mxf_d10_muxer) {