Commit ff4daed6 authored by Steve Lhomme's avatar Steve Lhomme
Browse files

video_output: drop reused pictures if they are late

The reused picture happens when the decoding+display starts or after a flush.

In the former case it's possible the decoder took some time and we have fresher
pictures available.

In the latter case the kept decoded picture may be very old and we shouldn't be
reusing if it's late.

In both cases, there will be fresher ones coming if the one left was too late.
parent e2478631
......@@ -1122,10 +1122,9 @@ static picture_t *ThreadGetPrerenderedLocked(vout_thread_sys_t *vout, bool reuse
decoded = picture_Hold(sys->displayed.decoded);
} else {
decoded = picture_fifo_Pop(sys->decoder_fifo);
if (!decoded)
if (decoded) {
if (DropLate(vout, decoded, can_drop_late, paused))
vlc_video_context *pic_vctx = picture_GetVideoContext(decoded);
if (!VideoFormatIsCropArEqual(&decoded->format, &sys->filter.src_fmt))
......@@ -1140,12 +1139,11 @@ static picture_t *ThreadGetPrerenderedLocked(vout_thread_sys_t *vout, bool reuse
if (!decoded)
reuse_decoded = false;
if (DropLate(vout, decoded, can_drop_late, paused))
if (sys->displayed.decoded)
Supports Markdown
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