[vlc-devel] [PATCH 1/2] ts: fix demuxing of BluRay streams.
Ilkka Ollakka
ileoo at videolan.org
Thu Feb 6 16:05:32 CET 2014
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).
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;
--
Ilkka Ollakka
A bachelor never quite gets over the idea that he is a thing of beauty
and a boy for ever.
-- Helen Rowland
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140206/d42ea0c1/attachment.sig>
More information about the vlc-devel
mailing list