[vlc-devel] [PATCH] video_output: adapt the late threshold to the frame rate if there's one
Steve Lhomme
robux4 at videolabs.io
Thu Sep 14 14:47:29 CEST 2017
---
replaces https://patches.videolan.org/patch/18111/
- half a frame is the right threshold, not a full frame otherwise we can never
recover
---
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 c432c70aa0..f246ffa190 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -852,9 +852,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);
--
2.12.1
More information about the vlc-devel
mailing list