else
{
es_out_Control( p_demux->out, ES_OUT_SET_PCR,
- p_stream->i_pcr );
+ VLC_TS_0 + p_stream->i_pcr );
}
continue;
}
}
if( p_sys->i_pcr >= 0 )
- es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pcr );
+ es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_pcr );
return 1;
}
p_stream->p_headers =
realloc( p_sav = p_stream->p_headers, p_stream->i_headers +
p_oggpacket->bytes + (b_store_size ? 2 : 0) + (b_store_num_headers ? 1 : 0) );
- if( p_stream->p_headers )
+ if( !p_stream->p_headers )
+ p_stream->p_headers = p_sav;
+ else
{
uint8_t *p_extra = p_stream->p_headers + p_stream->i_headers;
p_ogg->i_bos--;
}
}
- else
- {
- p_stream->p_headers = p_sav;
- }
b_selected = false; /* Discard the header packet */
}
/* Call the pace control */
es_out_Control( p_demux->out, ES_OUT_SET_PCR,
- p_stream->i_pcr );
+ VLC_TS_0 + p_stream->i_pcr );
}
p_stream->i_previous_pcr = p_stream->i_pcr;
es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
/* Call the pace control */
- es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_stream->i_pcr );
+ es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_stream->i_pcr );
}
}
}
if( !( p_block = block_New( p_demux, p_oggpacket->bytes ) ) ) return;
/* Normalize PTS */
- if( i_pts == 0 ) i_pts = 1;
- else if( i_pts == -1 && i_interpolated_pts == 0 ) i_pts = 1;
- else if( i_pts == -1 ) i_pts = 0;
+ if( i_pts == 0 ) i_pts = VLC_TS_0;
+ else if( i_pts == -1 && i_interpolated_pts == 0 ) i_pts = VLC_TS_0;
+ else if( i_pts == -1 ) i_pts = VLC_TS_INVALID;
if( p_stream->fmt.i_cat == AUDIO_ES )
p_block->i_dts = p_block->i_pts = i_pts;
p_block->i_length = 0;
}
else if( p_stream->fmt.i_codec == VLC_CODEC_THEORA )
+ {
p_block->i_dts = p_block->i_pts = i_pts;
+ if( (p_oggpacket->granulepos & ((1<<p_stream->i_granule_shift)-1)) == 0 )
+ {
+ p_block->i_flags |= BLOCK_FLAG_TYPE_I;
+ }
+ }
else if( p_stream->fmt.i_codec == VLC_CODEC_DIRAC )
{
ogg_int64_t dts = p_oggpacket->granulepos >> 31;
uint64_t u_pnum = dts + delay;
p_block->i_dts = p_stream->i_pcr;
- p_block->i_pts = 0;
+ p_block->i_pts = VLC_TS_INVALID;
/* NB, OggDirac granulepos values are in units of 2*picturerate */
if( -1 != p_oggpacket->granulepos )
p_block->i_pts = u_pnum * INT64_C(1000000) / p_stream->f_rate / 2;
else
{
p_block->i_dts = i_pts;
- p_block->i_pts = 0;
+ p_block->i_pts = VLC_TS_INVALID;
}
if( p_stream->fmt.i_codec != VLC_CODEC_VORBIS &&
/* Check for audio header (old format) */
else if( GetDWLE((oggpacket.packet+96)) == 0x05589F81 )
{
- unsigned int i_extra_size;
+ int i_extra_size;
unsigned int i_format_tag;
p_stream->fmt.i_cat = AUDIO_ES;
else if( !strncmp( st->streamtype, "audio", 5 ) )
{
char p_buffer[5];
- unsigned int i_extra_size;
+ int i_extra_size;
int i_format_tag;
st->sh.audio.channels = GetWLE( &oggpacket.packet[1+44] );
switch( i_codec )
{
- /* 3 headers with the 2° one being the comments */
+ /* 3 headers with the 2° one being the comments */
case VLC_CODEC_VORBIS:
Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 1+6, false );
break;
Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 0, false );
break;
- /* N headers with the 2° one being the comments */
+ /* N headers with the 2° one being the comments */
case VLC_CODEC_KATE:
/* 1 byte for header type, 7 bit for magic, 1 reserved zero byte */
Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 1+7+1, true );
uint8_t *p = memchr( &p_oggpacket->packet[42], '\r',
p_oggpacket->bytes - 1 );
if( p && p[0] == '\r' && p[1] == '\n' )
- sscanf( (char*)(&p_oggpacket->packet[42]), "%1024s\r\n",
+ sscanf( (char*)(&p_oggpacket->packet[42]), "%1023s\r\n",
content_type_string );
}