fix continuity counter to start at 0
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Tue, 3 Jun 2008 00:53:33 +0000 (00:53 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Tue, 3 Jun 2008 00:53:33 +0000 (00:53 +0000)
Originally committed as revision 13641 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/mpegtsenc.c

index b5ba32d2ff2b7c2d8b6b8e32f6a85c2e655e9800..a3cc4289006da70b9e8c48ccb769f968600f8458 100644 (file)
@@ -61,8 +61,8 @@ static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len)
             b |= 0x40;
         *q++ = b;
         *q++ = s->pid;
-        s->cc = (s->cc + 1) & 0xf;
         *q++ = 0x10 | s->cc;
+        s->cc = (s->cc + 1) & 0xf;
         if (first)
             *q++ = 0; /* 0 offset */
         len1 = TS_PACKET_SIZE - (q - packet);