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

Måns Rullgård mans
Sun Sep 2 13:28:28 CEST 2007


Limin Wang <lance.lmwang at gmail.com> writes:

> Hi,
>
> * M?ns Rullg?rd <mans at mansr.com> [2007-08-31 22:07:07 +0100]:
>
>> Jindrich Makovicka <makovick at gmail.com> writes:
>> 
>> > 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.
>> 
>> Indeed.
>
> OK, then I think another CC incremented place need be fixed. See
> attached patch.

The muxer never writes packets without payload so this is not actually
needed.  Since the TS muxer is due for replacement anyway, I'd rather
not spend too much time on the current implementation.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list