[vlc-devel] [PATCH] Allow the ES block fifo to store PCR
Francois Cartegnie
fcvlcdev at free.fr
Mon Mar 2 14:36:56 CET 2020
Le 01/03/2020 à 16:00, Denis Charmet a écrit :
> +int vlc_es_fifo_SetPcr(struct vlc_es_fifo_t *fifo, vlc_tick_t pcr)
> +{
> + vlc_mutex_lock(&fifo->lock);
> +
> + struct vlc_pcr_block_fifo_t *p_pcr_fifo = fifo->p_last;
> + if (p_pcr_fifo->p_first == NULL || p_pcr_fifo->i_pcr == pcr)
> + p_pcr_fifo->i_pcr = pcr; /* Reuse empty or same pcr_block fifo */
> + else
> + {
> + p_pcr_fifo = pcr_fifo_New(pcr);
> + if (p_pcr_fifo == NULL)
> + {
> + vlc_mutex_unlock(&fifo->lock);
> + return 1;
> + }
> + fifo->p_last->p_next = p_pcr_fifo;
> + fifo->p_last = p_pcr_fifo;
> + }
> + vlc_mutex_unlock(&fifo->lock);
> + return 0;
I 'm not sure having structs parenting blocks to pcr is the best way as
this does not allow any flexibility if we want to store something else.
Maybe we should reconsider, just store a struct in a regular fifo (
duplicate pcr values as long as it does not change).
--
Francois Cartegnie
VideoLAN - VLC Developer
More information about the vlc-devel
mailing list