* ps.h: Program Stream demuxer helper
*****************************************************************************
* Copyright (C) 2004 VideoLAN
- * $Id: ps.h,v 1.2 2004/01/17 23:51:50 fenrir Exp $
+ * $Id: ps.h,v 1.5 2004/01/30 01:09:24 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
{
if( ( i_id&0xf8 ) == 0x88 )
{
- es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC( 'd', 't', 's', ' ' ) );
- tk->i_skip = 1;
+ es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('d','t','s',' ') );
+ tk->i_skip = 4;
}
else if( ( i_id&0xf0 ) == 0x80 )
{
- es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC( 'a', '5', '2', ' ' ) );
+ es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('a','5','2',' ') );
tk->i_skip = 4;
}
else if( ( i_id&0xe0 ) == 0x20 )
{
- es_format_Init( &tk->fmt, SPU_ES, VLC_FOURCC( 's', 'p', 'u', ' ' ) );
+ es_format_Init( &tk->fmt, SPU_ES, VLC_FOURCC('s','p','u',' ') );
tk->i_skip = 1;
}
else if( ( i_id&0xf0 ) == 0xa0 )
{
- es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC( 'l', 'p', 'c', 'm' ) );
+ es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('l','p','c','m') );
tk->i_skip = 1;
}
else if( ( i_id&0xff ) == 0x70 )
{
- es_format_Init( &tk->fmt, SPU_ES, VLC_FOURCC( 'o', 'g', 't', ' ' ) );
+ es_format_Init( &tk->fmt, SPU_ES, VLC_FOURCC('o','g','t',' ') );
}
else if( ( i_id&0xfc ) == 0x00 )
{
- es_format_Init( &tk->fmt, SPU_ES, VLC_FOURCC( 'c', 'v', 'd', ' ' ) );
+ es_format_Init( &tk->fmt, SPU_ES, VLC_FOURCC('c','v','d',' ') );
}
else
{
{
if( ( i_id&0xf0 ) == 0xe0 )
{
- es_format_Init( &tk->fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', 'g', 'v' ) );
+ es_format_Init( &tk->fmt, VIDEO_ES, VLC_FOURCC('m','p','g','v') );
}
else if( ( i_id&0xe0 ) == 0xc0 )
{
- es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC( 'm', 'p', 'g', 'a' ) );
+ es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('m','p','g','a') );
}
else
{
}
/* parse a PACK PES */
-static inline int ps_pkt_parse_pack( block_t *p_pkt, int64_t *pi_scr, int *pi_mux_rate )
+static inline int ps_pkt_parse_pack( block_t *p_pkt, int64_t *pi_scr,
+ int *pi_mux_rate )
{
uint8_t *p = p_pkt->p_buffer;
if( p_pkt->i_buffer >= 14 && (p[4] >> 6) == 0x01 )
}
/* Parse a SYSTEM PES */
-static inline int ps_pkt_parse_system( block_t *p_pkt, ps_track_t tk[PS_TK_COUNT] )
+static inline int ps_pkt_parse_system( block_t *p_pkt,
+ ps_track_t tk[PS_TK_COUNT] )
{
uint8_t *p = &p_pkt->p_buffer[6 + 3 + 1 + 1 + 1];
(mtime_t)(header[10] << 22)|
((mtime_t)(header[11]&0xfe) << 14)|
(mtime_t)(header[12] << 7)|
- (mtime_t)(header[12] >> 1);
+ (mtime_t)(header[13] >> 1);
if( header[7]&0x40 ) /* has dts */
{
- p_pes->i_dts = ((mtime_t)(header[13]&0x0e ) << 29)|
- (mtime_t)(header[14] << 22)|
- ((mtime_t)(header[15]&0xfe) << 14)|
- (mtime_t)(header[16] << 7)|
- (mtime_t)(header[17] >> 1);
+ p_pes->i_dts = ((mtime_t)(header[14]&0x0e ) << 29)|
+ (mtime_t)(header[15] << 22)|
+ ((mtime_t)(header[16]&0xfe) << 14)|
+ (mtime_t)(header[17] << 7)|
+ (mtime_t)(header[18] >> 1);
}
}
}