<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Good point. Here is the revised patch.<br>
<br>
<tt>diff --git a/src/libvlc-module.c b/src/libvlc-module.c</tt><tt><br>
</tt><tt>index 46180f5..7293a6d 100644</tt><tt><br>
</tt><tt>--- a/src/libvlc-module.c</tt><tt><br>
</tt><tt>+++ b/src/libvlc-module.c</tt><tt><br>
</tt><tt>@@ -482,6 +482,10 @@ static const char *const
ppsz_pos_descriptions[] =</tt><tt><br>
</tt><tt> #define MOUSE_EVENTS_LONGTEXT N_( \</tt><tt><br>
</tt><tt> "This enables handling of mouse clicks on the video."
)</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt>+#define DISPLAY_LATE_THRESHOLD_TEXT N_("Display late
threshold")</tt><tt><br>
</tt><tt>+#define DISPLAY_LATE_THRESHOLD_LONGTEXT N_( \</tt><tt><br>
</tt><tt>+ "VOUT Display late threshold in ms." )</tt><tt><br>
</tt><tt>+</tt><tt><br>
</tt><tt> /*****************************************************************************</tt><tt><br>
</tt><tt> * Input</tt><tt><br>
</tt><tt>
****************************************************************************/</tt><tt><br>
</tt><tt>@@ -1605,6 +1609,9 @@ vlc_module_begin ()</tt><tt><br>
</tt><tt> add_module_list( "video-splitter", "video splitter",
NULL,</tt><tt><br>
</tt><tt> VIDEO_SPLITTER_TEXT,
VIDEO_SPLITTER_LONGTEXT, false )</tt><tt><br>
</tt><tt> add_obsolete_string( "vout-filter" ) /* since 2.0.0 */</tt><tt><br>
</tt><tt>+</tt><tt><br>
</tt><tt>+ add_integer( "display-late-threshold", 20,
DISPLAY_LATE_THRESHOLD_TEXT,</tt><tt><br>
</tt><tt>+ DISPLAY_LATE_THRESHOLD_LONGTEXT, true )</tt><tt><br>
</tt><tt> #if 0</tt><tt><br>
</tt><tt> add_string( "pixel-ratio", "1", PIXEL_RATIO_TEXT,
PIXEL_RATIO_TEXT )</tt><tt><br>
</tt><tt> #endif</tt><tt><br>
</tt><tt>diff --git a/src/video_output/video_output.c
b/src/video_output/video_output.c</tt><tt><br>
</tt><tt>index 40701b7..c82ebb3 100644</tt><tt><br>
</tt><tt>--- a/src/video_output/video_output.c</tt><tt><br>
</tt><tt>+++ b/src/video_output/video_output.c</tt><tt><br>
</tt><tt>@@ -63,11 +63,6 @@ static void VoutDestructor(vlc_object_t
*);</tt><tt><br>
</tt><tt> */</tt><tt><br>
</tt><tt> #define VOUT_REDISPLAY_DELAY (INT64_C(80000))</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt>-/**</tt><tt><br>
</tt><tt>- * Late pictures having a delay higher than this value are
thrashed.</tt><tt><br>
</tt><tt>- */</tt><tt><br>
</tt><tt>-#define VOUT_DISPLAY_LATE_THRESHOLD (INT64_C(20000))</tt><tt><br>
</tt><tt>-</tt><tt><br>
</tt><tt> /* Better be in advance when awakening than late... */</tt><tt><br>
</tt><tt> #define VOUT_MWAIT_TOLERANCE (INT64_C(4000))</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt>@@ -159,6 +154,9 @@ static vout_thread_t
*VoutCreate(vlc_object_t *object,</tt><tt><br>
</tt><tt> /* */</tt><tt><br>
</tt><tt> vout_InitInterlacingSupport(vout,
vout->p->displayed.is_interlaced);</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt>+ vout->p->display_late_threshold =
var_InheritInteger(vout, "display-late-threshold") * 1000;</tt><tt><br>
</tt><tt>+</tt><tt><br>
</tt><tt>+</tt><tt><br>
</tt><tt> /* Window */</tt><tt><br>
</tt><tt> if (vout->p->splitter_name == NULL) {</tt><tt><br>
</tt><tt> vout_window_cfg_t wcfg = {</tt><tt><br>
</tt><tt>@@ -786,7 +784,7 @@ static int
ThreadDisplayPreparePicture(vout_thread_t *vout, bool reuse, bool
fra</tt><tt><br>
</tt><tt> if (is_late_dropped &&
!decoded->b_force) {</tt><tt><br>
</tt><tt> const mtime_t predicted = mdate() + 0;
/* TODO improve */</tt><tt><br>
</tt><tt> const mtime_t late = predicted -
decoded->date;</tt><tt><br>
</tt><tt>- if (late >
VOUT_DISPLAY_LATE_THRESHOLD) {</tt><tt><br>
</tt><tt>+ if (late >
vout->p->display_late_threshold) {</tt><tt><br>
</tt><tt> msg_Warn(vout, "picture is too
late to be displayed (missing %"PRId64" ms)", late/1000);</tt><tt><br>
</tt><tt> picture_Release(decoded);</tt><tt><br>
</tt><tt>
vout_statistic_AddLost(&vout->p->statistic, 1);</tt><tt><br>
</tt><tt>diff --git a/src/video_output/vout_internal.h
b/src/video_output/vout_internal.h</tt><tt><br>
</tt><tt>index 3b01567..5b6e792 100644</tt><tt><br>
</tt><tt>--- a/src/video_output/vout_internal.h</tt><tt><br>
</tt><tt>+++ b/src/video_output/vout_internal.h</tt><tt><br>
</tt><tt>@@ -112,6 +112,7 @@ struct vout_thread_sys_t</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt> /* */</tt><tt><br>
</tt><tt> bool is_late_dropped;</tt><tt><br>
</tt><tt>+ long display_late_threshold; /* The amount
if time in us that a picture can be late and still displayed */</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt> /* Video filter2 chain */</tt><tt><br>
</tt><tt> struct {</tt><tt><br>
</tt><br>
<br>
<div class="moz-signature">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<img moz-do-not-send="false"
src="cid:part1.09040405.04060308@openroadsconsulting.com">
<p
style="margin-top:0pt;margin-right:0pt;margin-bottom:.0001pt;margin-left:0pt;"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red">----------------------------------------------------------------------------</span></p>
<p
style="margin-top:0pt;margin-right:0pt;margin-bottom:.0001pt;margin-left:0pt;"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;"
lang="EN-GB">David R Robison</span></p>
<p
style="margin-top:0pt;margin-right:0pt;margin-bottom:.0001pt;margin-left:0pt;"><b><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#002060;"
lang="EN-GB">Principal Systems Engineer</span></b></p>
<p
style="margin-top:0pt;margin-right:0pt;margin-bottom:.0001pt;margin-left:0pt;"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;"
lang="EN-GB">+1 757 546 3401 (o)</span></p>
<p
style="margin-top:0pt;margin-right:0pt;margin-bottom:.0001pt;margin-left:0pt;"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;
\" lang="EN-GB">+1 757 286 0022 (m)</span></p>
<p
style="margin-top:0pt;margin-right:0pt;margin-bottom:.0001pt;margin-left:0pt;t"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";"
lang="EN-GB"><a
href="mailto:david.robison@openroadsconsulting.com">david.robison@openroadsconsulting.com</a></span></p>
<p
style="margin-top:0pt;margin-right:0pt;margin-bottom:.0001pt;margin-left:0pt;><a
href="http://www.openroadsconsulting.com/"><span
lang=EN-GB style="
font-size:10.0pt;font-family:"arial","sans-serif";'=""><a class="moz-txt-link-abbreviated" href="http://www.openroadsconsulting.com">www.openroadsconsulting.com</a></p>
<p
style="margin-top:0pt;margin-right:0pt;margin-bottom:.0001pt;margin-left:0pt;"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red">----------------------------------------------------------------------------</span></p>
<p
style="margin-top:0pt;margin-right:0pt;margin-bottom:.0001pt;margin-left:0pt;"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;"
lang="EN-GB">Open Roads Consulting </span></p>
<p
style="margin-top:0pt;margin-right:0pt;margin-bottom:.0001pt;margin-left:0pt;"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;"
lang="EN-GB">A Q-Free Company</span></p>
<p
style="margin-top:0pt;margin-right:0pt;margin-bottom:.0001pt;margin-left:0pt;"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#002060;"
lang="EN-GB">103 Watson Rd. Chesapeake VA 23320</span></p>
</div>
<div class="moz-cite-prefix">On 3/27/2015 2:27 PM, Rémi
Denis-Courmont wrote:<br>
</div>
<blockquote cite="mid:2563903.izlKKkAtuV@basile.remlab.net"
type="cite">
<pre wrap="">Le jeudi 26 mars 2015, 14:22:16 David R. Robison a écrit :
</pre>
<blockquote type="cite">
<pre wrap="">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 <a class="moz-txt-link-rfc2396E" href="mailto:david.robison@openroadsconsulting.com"><david.robison@openroadsconsulting.com></a>
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;
</pre>
</blockquote>
<pre wrap="">
Contending for the vout variable lock in a time critical code path is probably
not a good idea.
</pre>
<blockquote type="cite">
<pre wrap="">+ 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);
</pre>
<blockquote type="cite">
<pre wrap="">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:
<a class="moz-txt-link-freetext" href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a>
</pre>
</blockquote>
<pre wrap="">
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.
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<br>
<BR />
<BR />
<HR />
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.<BR />
If you are not the intended recipient, please delete this email immediately.<BR />
</body>
</html>