Commit 09fbe460 authored by Thomas Guillem's avatar Thomas Guillem
Browse files

vout: don't query the clock if not needed

It is not needed if the picture is forced or if we don't care about
frame lateness (frame_next).
parent 1cb0afc2
...@@ -991,26 +991,29 @@ static picture_t *ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reus ...@@ -991,26 +991,29 @@ static picture_t *ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reus
decoded = picture_fifo_Pop(sys->decoder_fifo); decoded = picture_fifo_Pop(sys->decoder_fifo);
if (decoded) { if (decoded) {
const vlc_tick_t system_now = vlc_tick_now(); if (is_late_dropped && !decoded->b_force)
const vlc_tick_t system_pts =
vlc_clock_ConvertToSystem(sys->clock, system_now,
decoded->date, sys->rate);
if (system_pts == INT64_MAX)
{
/* The clock is paused, notify it (so that the current
* picture is displayed but not the next one), this
* current picture can't be be late. */
*paused = true;
}
else if (is_late_dropped && !decoded->b_force)
{ {
if (ThreadDisplayIsPictureLate(vout, decoded, system_now, const vlc_tick_t system_now = vlc_tick_now();
system_pts)) const vlc_tick_t system_pts =
vlc_clock_ConvertToSystem(sys->clock, system_now,
decoded->date, sys->rate);
if (system_pts == INT64_MAX)
{
/* The clock is paused, notify it (so that the current
* picture is displayed but not the next one), this
* current picture can't be be late. */
*paused = true;
}
else
{ {
picture_Release(decoded); if (ThreadDisplayIsPictureLate(vout, decoded, system_now,
vout_statistic_AddLost(&sys->statistic, 1); system_pts))
continue; {
picture_Release(decoded);
vout_statistic_AddLost(&sys->statistic, 1);
continue;
}
} }
} }
vlc_video_context *pic_vctx = picture_GetVideoContext(decoded); vlc_video_context *pic_vctx = picture_GetVideoContext(decoded);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment