Browse Source

demux: ogg: fix first oggds timestamps/drop regression

oggds uses 0 on first frame :/

(cherry picked from commit a09fbee518)
pull/135/head
Francois Cartegnie 8 years ago
parent
commit
6ae64201ef
  1. 11
      modules/demux/ogg.c
  2. 3
      modules/demux/oggseek.c

11
modules/demux/ogg.c

@ -1012,6 +1012,10 @@ static void Ogg_UpdatePCR( demux_t *p_demux, logical_stream_t *p_stream,
{
/* We're in headers, and we haven't parsed 1st data packet yet */
// p_stream->i_pcr = VLC_TS_UNKNOWN;
if( p_stream->b_oggds && ogg_page_packets( p_oggpacket ) )
{
p_stream->i_pcr = VLC_TS_0 + p_ogg->i_nzpcr_offset;
}
}
else if( p_oggpacket->granulepos > 0 )
{
@ -1168,7 +1172,12 @@ static void Ogg_SendOrQueueBlocks( demux_t *p_demux, logical_stream_t *p_stream,
temp = temp->p_next;
tosend->p_next = NULL;
if( tosend->i_pts < VLC_TS_0 )
if( tosend->i_dts < VLC_TS_0 )
{
tosend->i_dts = tosend->i_pts;
}
if( tosend->i_dts < VLC_TS_0 )
{
/* Don't send metadata from chained streams */
block_Release( tosend );

3
modules/demux/oggseek.c

@ -678,12 +678,11 @@ int64_t Oggseek_GranuleToAbsTimestamp( logical_stream_t *p_stream,
int64_t i_granule, bool b_presentation )
{
int64_t i_timestamp = -1;
if ( i_granule < 1 )
if ( i_granule < 1 - !!p_stream->b_oggds )
return -1;
if ( p_stream->b_oggds )
{
if ( b_presentation ) i_granule--;
i_timestamp = i_granule * CLOCK_FREQ / p_stream->f_rate;
}
else switch( p_stream->fmt.i_codec )

Loading…
Cancel
Save