[FFmpeg-devel] [PATCH] fix ts Continuity Count

Jindrich Makovicka makovick
Fri Aug 31 21:55:06 CEST 2007


On Fri, 31 Aug 2007 10:03:41 +0100 (BST)
M?ns Rullg?rd <mans at mansr.com> wrote:
> >> > @@ -60,8 +60,8 @@
> >> >              b |= 0x40;
> >> >          *q++ = b;
> >> >          *q++ = s->pid;
> >> > +        *q++ = 0x10 | s->cc;
> >> >          s->cc = (s->cc + 1) & 0xf;
> >> > -        *q++ = 0x10 | s->cc;
> >> >          if (first)
> >> >              *q++ = 0; /* 0 offset */
> >> >          len1 = TS_PACKET_SIZE - (q - packet);
> >>
> >> Why is this needed?  It only shifts the continuity counter by one.
> >
> > It'll cause the first cc start from 1 always, vlc will give warning
> > about it.
> 
> So fix VLC.
 
Moreover, this change is wrong because the code will break if someone
tries to insert some dummy packets without payload, i.e. no CC
change. CC _must_ be incremented before being stored into the cc field,
not after.

A possible workaround would be using 0x0f as an initial CC value.

Regards,
-- 
Jindrich Makovicka




More information about the ffmpeg-devel mailing list