2011/6/27 Måns Rullgård <[email protected]>

> Luca Barbato <[email protected]> writes:
>
> > If the Continuity Check fails drop the whole packet
> > ---
> >  libavformat/mpegts.c |    5 ++++-
> >  1 files changed, 4 insertions(+), 1 deletions(-)
> >
> > diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
> > index f2ae567..05bc4dc 100644
> > --- a/libavformat/mpegts.c
> > +++ b/libavformat/mpegts.c
> > @@ -1267,7 +1267,10 @@ static int handle_packet(MpegTSContext *ts, const
> uint8_t *packet)
> >      cc = (packet[3] & 0xf);
> >      cc_ok = (tss->last_cc < 0) || ((((tss->last_cc + 1) & 0x0f) == cc));
> >      tss->last_cc = cc;
> > -
> > +    if (!cc_ok) {
> > +        av_log(NULL, AV_LOG_WARNING, "Continuity Check Failed\n");
> > +        return -1;
> > +    }
> >      /* skip adaptation field */
> >      afc = (packet[3] >> 4) & 3;
> >      p = packet + 4;
> > --
>
> I still consider this overkill.  The packet could contain any number of
> undamaged frames which would be needlessly discarded with this change.
>
>
Perhaps I'm wrong, but as I understand video encapsulation in TS:

   1. a PES packet is simply a single compressed video frame
   2. therefore each TS packet will contain data from at most 1 video frame
   3. therefore detecting continuity counter errors suggests that the video
   frame data is corrupt

so I don't understand where's the overkill.


-- 
Aviad Rozenhek
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to