vlc | branch: master | Steve Lhomme <rob...@ycbcr.xyz> | Thu Sep 14 12:35:43 
2017 +0200| [d5255d78d2cc7f3939522f26e0c8f971af1d6fc7] | committer: Steve Lhomme

video_output: adapt the late threshold to the frame rate if there's one

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d5255d78d2cc7f3939522f26e0c8f971af1d6fc7
---

 src/video_output/video_output.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 9108e876df..e1ae9f023a 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -862,9 +862,14 @@ static int ThreadDisplayPreparePicture(vout_thread_t 
*vout, bool reuse, bool fra
             decoded = picture_fifo_Pop(vout->p->decoder_fifo);
             if (decoded) {
                 if (is_late_dropped && !decoded->b_force) {
+                    mtime_t late_threshold;
+                    if (decoded->format.i_frame_rate && 
decoded->format.i_frame_rate_base)
+                        late_threshold = ((CLOCK_FREQ/2) * 
decoded->format.i_frame_rate_base) / decoded->format.i_frame_rate;
+                    else
+                        late_threshold = VOUT_DISPLAY_LATE_THRESHOLD;
                     const mtime_t predicted = mdate() + 0; /* TODO improve */
                     const mtime_t late = predicted - decoded->date;
-                    if (late > VOUT_DISPLAY_LATE_THRESHOLD) {
+                    if (late > late_threshold) {
                         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);

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to