Commit a09fbee5 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: ogg: fix first oggds timestamps/drop regression

oggds uses 0 on first frame :/
parent e235d31e
......@@ -1025,6 +1025,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 )
{
......@@ -1181,7 +1185,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 );
......
......@@ -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 )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment