[vlc-devel] [PATCH v2 3/4] video_output: keep the displayed.current in frame by frame if next is not ready
Steve Lhomme
robux4 at ycbcr.xyz
Tue Nov 17 15:35:34 CET 2020
And no need to reuse displayed.next which is always NULL otherwise.
---
src/video_output/video_output.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index c86b4ff865c..f55643e47c5 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1487,16 +1487,15 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
bool render_now;
if (frame_by_frame)
{
- if (!sys->displayed.next)
- {
- sys->displayed.next =
- ThreadDisplayPreparePicture(vout, false, true, &paused);
- }
+ picture_t *next =
+ ThreadDisplayPreparePicture(vout, false, true, &paused);
+
+ if (next == NULL)
+ return VLC_EGENERIC;
if (likely(sys->displayed.current != NULL))
picture_Release(sys->displayed.current);
- sys->displayed.current = sys->displayed.next;
- sys->displayed.next = NULL;
+ sys->displayed.current = next;
render_now = true;
}
--
2.26.2
More information about the vlc-devel
mailing list