[vlc-devel] [PATCH 00/17] Fixing normal_time handling
thomas at gllm.fr
Thu Mar 11 10:38:00 UTC 2021
On Wed, Mar 10, 2021, at 15:19, Rémi Denis-Courmont wrote:
> Le mercredi 10 mars 2021, 15:33:55 EET Thomas Guillem a écrit :
> > FYI, GET_TIME is stil used by the player timer to report the time when the
> > demux doesn't have any programs/PCR/ES (so no valid data).
> You can't have it both ways. Either the value is polled or it's reported via
> asynchronous events.
> It made no sense to have separate GET_TIME and GET_NORMAL_TIME, and it would
> make no sense to have separate GET_TIME polled and NPT as an event. They are
> by definition one and the same thing: the time to show to the user.
> And it does not seem to belong in SetPCR either way.
In practice, implementing GET_NORMAL_TIME is way harder to just send the matching time of the PCR.
Let's see dvdnav for example:
static int Control( demux_t *p_demux, int i_query, va_list args )
if( p_sys->i_pgc_length > 0 )
*va_arg( args, vlc_tick_t * ) =
dvdnav_get_current_time( p_sys->dvdnav ) * 100 / 9;
static int DemuxBlock( demux_t *p_demux, const uint8_t *p, int len )
if( !ps_pkt_parse_pack( p_pkt->p_buffer, p_pkt->i_buffer,
&i_scr, &i_mux_rate ) )
es_out_SetPCR( p_sys->p_tf_out, i_scr );
if( i_mux_rate > 0 ) p_sys->i_mux_rate = i_mux_rate;
block_Release( p_pkt );
Here, DEMUX_GET_NORMAL_TIME = DEMUX_GET_TIME - i_scr.
The i_scr is not known from Control(), so it needs to be saved in an intermediate variable.
And it will be the same for all modules.
I can do as you say, but I prefer my way. Francois, what do you think ?
> Rémi Denis-Courmont
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
More information about the vlc-devel