Commit 6a14d10b authored by Denis Charmet's avatar Denis Charmet Committed by Jean-Baptiste Kempf

Ogg: allow sending VLC_TS_INVALID when used as slave

Fix #18757

This needs a better fix for 4.0, btw...
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent b4247bb5
......@@ -321,7 +321,8 @@ static int Demux( demux_t * p_demux )
if( i_lastpcr > VLC_TS_INVALID )
{
p_sys->i_nzpcr_offset = i_lastpcr - VLC_TS_0;
es_out_SetPCR( p_demux->out, i_lastpcr );
if( likely( !p_sys->b_slave ) )
es_out_SetPCR( p_demux->out, i_lastpcr );
}
p_sys->i_pcr = VLC_TS_INVALID;
}
......@@ -691,7 +692,8 @@ static int Demux( demux_t * p_demux )
if( ! b_skipping && p_sys->b_preparsing_done )
{
p_sys->i_pcr = i_pcr_candidate;
es_out_SetPCR( p_demux->out, p_sys->i_pcr );
if( likely( !p_sys->b_slave ) )
es_out_SetPCR( p_demux->out, p_sys->i_pcr );
}
}
......@@ -782,8 +784,12 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
*pb_bool = true;
return VLC_SUCCESS;
case DEMUX_SET_NEXT_DEMUX_TIME:
p_sys->b_slave = true;
return VLC_EGENERIC;
case DEMUX_GET_TIME:
if( p_sys->i_pcr > VLC_TS_INVALID )
if( p_sys->i_pcr > VLC_TS_INVALID || p_sys->b_slave )
{
pi64 = va_arg( args, int64_t * );
*pi64 = p_sys->i_pcr;
......@@ -1161,7 +1167,8 @@ static void Ogg_SendOrQueueBlocks( demux_t *p_demux, logical_stream_t *p_stream,
if ( p_ogg->i_pcr < VLC_TS_0 && i_firstpts > VLC_TS_INVALID )
{
p_ogg->i_pcr = i_firstpts;
es_out_SetPCR( p_demux->out, p_ogg->i_pcr );
if( likely( !p_ogg->b_slave ) )
es_out_SetPCR( p_demux->out, p_ogg->i_pcr );
}
}
p_stream->p_preparse_block = NULL;
......
......@@ -232,6 +232,8 @@ struct demux_sys_t
/* Length, if available. */
int64_t i_length;
bool b_slave;
};
......
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