[vlc-devel] [PATCH 1/2] ts: fix demuxing of BluRay streams.

Petri Hintukainen phintuka at users.sourceforge.net
Fri Feb 7 02:08:41 CET 2014


On to, 2014-02-06 at 17:05 +0200, Ilkka Ollakka wrote:
> On Thu, Feb 06, 2014 at 03:33:24PM +0100, Rafaël Carré wrote:
> > On 02/04/14 23:37, Petri Hintukainen wrote:
> 
> Hi,
> 
> > > -static int DetectPacketSize( demux_t *p_demux )
> > > +static int DetectPacketSize( demux_t *p_demux, int *pi_header_size )
> > >  {
> > >      const uint8_t *p_peek;
> > >      if( stream_Peek( p_demux->s,
> > >                       &p_peek, TS_PACKET_SIZE_MAX ) < TS_PACKET_SIZE_MAX )
> > >          return -1;
> 
> > > +    *pi_header_size = 0;
> > > +
> > >      if( memcmp( p_peek, "TFrc", 4 ) == 0 )
> > >      {
> > >  #if 0
> > > @@ -483,6 +488,10 @@ static int DetectPacketSize( demux_t *p_demux )
> > >                   p_peek[i_sync + 2 * TS_PACKET_SIZE_192] == 0x47 &&
> > >                   p_peek[i_sync + 3 * TS_PACKET_SIZE_192] == 0x47 )
> > >          {
> > > +            if( i_sync == 4 )
> > > +            {
> > > +                *pi_header_size = 4; /* BluRay TS packets have 4-byte header */
> > > +            }
> 
> Why not just set pi_header_size to be i_packet_size-TS_PACKET_SIZE_188 ?
> as the it should cover also that 204 case (not sure if those are at all
> common).

I think those 16 bytes are after 188-byte ts packet, not before.

> Otherwise it looks ok, but I can't test it before tomorrow.
> 
> > >      /* Search first sync byte */
> > > -    i_packet_size = DetectPacketSize( p_demux );
> > > +    i_packet_size = DetectPacketSize( p_demux, &i_packet_header_size );
> > >      if( i_packet_size < 0 )
> > >          return VLC_EGENERIC;
> 
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel





More information about the vlc-devel mailing list