[vlc-devel] [PATCH] Let the threshold for discarding late displays be specified, on the command line

Rémi Denis-Courmont remi at remlab.net
Fri Mar 27 19:27:25 CET 2015


Le jeudi 26 mars 2015, 14:22:16 David R. Robison a écrit :
> Sorry, I muffed the git send-mail. This is what I intended to send...
> 
> When playing live video, sometimes the arriving packets exceed the 20ms
> limit for displaying late pictures. I'm proposing a change to allow this
> value to be set on the command line.
> 
> 
> 
>  From 9ce5a84754b992b8a61b93f79c63baec6c4867eb Mon Sep 17 00:00:00 2001
> From: David R Robison <david.robison at openroadsconsulting.com>
> Date: Thu, 26 Mar 2015 11:13:33 -0700
> Subject: [PATCH] Let the threshold for discarding late displays be specified
> on the command line
> 
> ---
>   src/libvlc-module.c             | 7 +++++++
>   src/video_output/video_output.c | 8 ++------
>   2 files changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/src/libvlc-module.c b/src/libvlc-module.c
> index 46180f5..7293a6d 100644
> --- a/src/libvlc-module.c
> +++ b/src/libvlc-module.c
> @@ -482,6 +482,10 @@ static const char *const ppsz_pos_descriptions[] =
>   #define MOUSE_EVENTS_LONGTEXT N_( \
>       "This enables handling of mouse clicks on the video." )
> 
> +#define DISPLAY_LATE_THRESHOLD_TEXT N_("Display late threshold")
> +#define DISPLAY_LATE_THRESHOLD_LONGTEXT N_( \
> +    "VOUT Display late threshold in ms." )
> +
>  
> /**************************************************************************
> *** * Input
> ****************************************************************************
> / @@ -1605,6 +1609,9 @@ vlc_module_begin ()
>       add_module_list( "video-splitter", "video splitter", NULL,
>                        VIDEO_SPLITTER_TEXT, VIDEO_SPLITTER_LONGTEXT, false )
> add_obsolete_string( "vout-filter" ) /* since 2.0.0 */
> +
> +    add_integer( "display-late-threshold", 20, DISPLAY_LATE_THRESHOLD_TEXT,
> +              DISPLAY_LATE_THRESHOLD_LONGTEXT, true )
>   #if 0
>       add_string( "pixel-ratio", "1", PIXEL_RATIO_TEXT, PIXEL_RATIO_TEXT )
>   #endif
> diff --git a/src/video_output/video_output.c
> b/src/video_output/video_output.c
> index 40701b7..3374154 100644
> --- a/src/video_output/video_output.c
> +++ b/src/video_output/video_output.c
> @@ -63,11 +63,6 @@ static void VoutDestructor(vlc_object_t *);
>    */
>   #define VOUT_REDISPLAY_DELAY (INT64_C(80000))
> 
> -/**
> - * Late pictures having a delay higher than this value are thrashed.
> - */
> -#define VOUT_DISPLAY_LATE_THRESHOLD (INT64_C(20000))
> -
>   /* Better be in advance when awakening than late... */
>   #define VOUT_MWAIT_TOLERANCE (INT64_C(4000))
> 
> @@ -786,7 +781,8 @@ static int ThreadDisplayPreparePicture(vout_thread_t
> *vout, bool reuse, bool fra
>                   if (is_late_dropped && !decoded->b_force) {
>                       const mtime_t predicted = mdate() + 0; /* TODO
> improve */
>                       const mtime_t late = predicted - decoded->date;
> -                    if (late > VOUT_DISPLAY_LATE_THRESHOLD) {
> +                    long display_late = var_InheritInteger(vout,
> "display-late-threshold") * 1000;

Contending for the vout variable lock in a time critical code path is probably 
not a good idea.

> +                    if (late > display_late) {
>                           msg_Warn(vout, "picture is too late to be
> displayed (missing %"PRId64" ms)", late/1000);
>                           picture_Release(decoded);
> vout_statistic_AddLost(&vout->p->statistic, 1);
> 
> > When playing live video, sometimes the arriving packets exceed the 20ms
> > limit for displaying late pictures. I'm proposing a change to allow this
> > value to be set on the command line.
> > 
> > 
> > 
> > This email communication (including any attachments) may contain
> > confidential and/or privileged material intended solely for the
> > individual or entity to which it is addressed. If you are not the
> > intended recipient, please delete this email immediately.
> > 
> > _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > https://mailman.videolan.org/listinfo/vlc-devel
> 
> This email communication (including any attachments) may contain
> confidential and/or privileged material intended solely for the individual
> or entity to which it is addressed. If you are not the intended recipient,
> please delete this email immediately.

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list