[vlc-devel] [PATCH 1/1] Fixed expansive loop when there is a clock gap
Jeremy Vignelles
jeremy.vignelles at dev3i.fr
Fri Oct 20 09:21:08 CEST 2017
> Le 19 octobre 2017 à 19:57, Rémi Denis-Courmont <remi at remlab.net> a écrit :
>
> Le torstaina 12. lokakuuta 2017, 16.38.02 EEST Jérémy VIGNELLES a écrit :
>
> > ---
> > modules/stream_out/cycle.c | 17 +++++++++++++++--
> > 1 file changed, 15 insertions(+), 2 deletions(-)
> >
> > diff --git a/modules/stream_out/cycle.c b/modules/stream_out/cycle.c
> > index bb031f81ae..a76d2af46d 100644
> > --- a/modules/stream_out/cycle.c
> > +++ b/modules/stream_out/cycle.c
> > @@ -155,13 +155,26 @@ static int Send(sout_stream_t *stream,
> > sout_stream_id_sys_t *id, block_t *block)
> > {
> > sout_stream_sys_t *sys = stream->p_sys;
> > -
> >
> > * mtime_t block_clock;
> > for (block_t *next = block->p_next; block != NULL; block = next)
> > {
> > block->p_next = NULL;
> >
> > /* FIXME: deal with key frames properly */
> >
> > * while (sys->clock(block) >= sys->next->offset)
> >
> > * block_clock = sys->clock(block);
> > * if (block_clock >= sys->next->offset + sys->period)
> > * {
> > * // Clock gap! More than 1 complete cycle can be run
> > * mtime_t adjust_offset = ((block_clock - sys->next->offset) /
> > sys->period) * sys->period;
> > * msg_Dbg(stream, "Clock gap of more that
> > %llu cycle detected, fast-forwarding cycles", (block_clock -
> > sys->next->offset) / sys->period);
> > * // Adjust all offsets
> > * for(sout_cycle_t* cycle=sys->start;cycle != NULL; cycle = cycle->next)
> > * {
> > * cycle->offset += adjust_offset;
> > * }
> > * }
> > +
> > * while (block_clock >= sys->next->offset)
> > {
> > DelStream(stream);
> > AddStream(stream, sys->next->chain);
>
> AFAICT, this only solves the problem in the simple degenerate case.
>
> --
> 雷米‧德尼-库尔蒙
> https://www.remlab.net/
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
Hi,
Thanks for your reply. What do you mean by the "simple degenerate case" ?
If this patches makes the software better without having any downside, do you think it could be merged as-is, or should I make any other improvement?
Regards,
Jérémy VIGNELLES
More information about the vlc-devel
mailing list