[vlc-devel] [PATCH 14/16] video_output: rename ambiguous refresh flag to redisplay_needed

Alexandre Janniaux ajanni at videolabs.io
Sat Oct 17 15:41:43 CEST 2020


Hi,

I'm not sure why the renaming is needed, refresh is both for non
compositing window manager (see xrefresh) and for display manager
that might consider the window stalling otherwise (but it's less
usual). Refresh and redisplay here means the same thing.

It would be more understandable if you were to rename in a different
form, like «is_dirty» instead of «redisplay_needed» but I guess this
is not the best since it doesn't designate the final state.

If you are yo rename it anyway though, it would be better to have
adequate naming for 16/16 too (among what I noticed) since it adds
yet another naming for the same thing (refresh, render, redisplay)
though it deletes one another. In my opinion, it makes no sense to
just «cycle» the different naming for this.

Regards,
--
Alexandre Janniaux
Videolabs

On Fri, Oct 16, 2020 at 04:26:45PM +0200, Steve Lhomme wrote:
> This flag really tells if the original displayed.current needs to be
> re-displayed. It happens when the VOUT_REDISPLAY_DELAY threshold has passed.
>
> The displayed.date keeps track of the date displayed.current was last
> displayed.
> ---
>  src/video_output/video_output.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
> index 660cf7d5338..2c9c9252b79 100644
> --- a/src/video_output/video_output.c
> +++ b/src/video_output/video_output.c
> @@ -1543,21 +1543,22 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
>          *
>          * So it will be done later.
>          */
> -        bool refresh = false;
> +        bool redisplay_needed = false;
>
>          vlc_tick_t date_refresh = VLC_TICK_INVALID;
>          if (sys->displayed.date != VLC_TICK_INVALID) {
>              date_refresh = sys->displayed.date + VOUT_REDISPLAY_DELAY - render_delay;
> -            refresh = date_refresh <= system_now;
> +            redisplay_needed = date_refresh <= system_now;
>          }
> -        force_refresh = !dropped_current_frame && refresh;
> +        force_refresh = !dropped_current_frame && redisplay_needed;
>
>          if (date_refresh != VLC_TICK_INVALID)
>              *deadline = date_refresh;
>          if (date_next != VLC_TICK_INVALID && date_next < *deadline)
>              *deadline = date_next;
>
> -        if (!first && !refresh && !dropped_current_frame) {
> +        if (!first && !redisplay_needed && !dropped_current_frame) {
> +            // nothing changed, wait until the next deadline or a control
>              return VLC_EGENERIC;
>          }
>      }
> --
> 2.26.2
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list