[vlc-devel] [PATCH 12/21] video_output: always skip to the next frame if it's needed
Steve Lhomme
robux4 at ycbcr.xyz
Tue Sep 15 14:36:17 CEST 2020
Do it before any error return.
If display_next_frame is true we would never end up in the (moved) return, so
the logic is preserved.
---
src/video_output/video_output.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index edf4512b734..3f8263bc11a 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1544,10 +1544,6 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
}
}
- if (!current_needs_redisplay && !display_next_frame) {
- return VLC_EGENERIC;
- }
-
if (display_next_frame) {
picture_Release(sys->displayed.current);
if (first)
@@ -1561,6 +1557,12 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
if (!sys->displayed.current)
return VLC_EGENERIC;
+ if (!current_needs_redisplay && !display_next_frame) {
+ // we don't have to redisplay the current frame or display a new frame
+ // we woke up and (pre)rendered pictures for nothing
+ return VLC_EGENERIC;
+ }
+
/* display the picture immediately */
bool force_refresh = current_needs_redisplay && !display_next_frame;
bool is_forced = frame_by_frame || force_refresh || sys->displayed.current->b_force;
--
2.26.2
More information about the vlc-devel
mailing list