[vlc-commits] [Git][videolan/vlc][master] 2 commits: video_output: clarify the display.current replacement

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Jun 3 06:23:02 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
e6fe279c by Steve Lhomme at 2022-06-03T05:55:10+00:00
video_output: clarify the display.current replacement

We don't release the picture because there's dropped_current_frame. We have to
release it because we're replacing the value and we were holding the picture
in there.

- - - - -
dd8c8e03 by Steve Lhomme at 2022-06-03T05:55:10+00:00
video_output: remove dropped_current_frame test

When we go in the `(next != NULL)` section, we have a new picture to render.
We need to wait until its "refresh" date to start the rendering.
It doesn't matter if there was a picture shown before that one.

The code is almost the same as before where dropped_current_frame was almost
always true. The only time it was false was:
* first picture and next is not NULL (first pic & next NULL is impossible here)
* not first picture and next is NULL

So the new code only changes the case where it is the "first picture and next
is not NULL". But in that case, first was true and therefore the test was
not passing, just like now.

It is logically equivalent to the code before. But now it's clear that when we
don't have a next picture we request a redisplay (of displayed.current).

- - - - -


1 changed file:

- src/video_output/video_output.c


Changes:

=====================================
src/video_output/video_output.c
=====================================
@@ -1376,8 +1376,6 @@ static vlc_tick_t DisplayPicture(vout_thread_sys_t *vout)
     const vlc_tick_t render_delay = vout_chrono_GetHigh(&sys->chrono.render) + VOUT_MWAIT_TOLERANCE;
     const bool first = !sys->displayed.current;
 
-    bool dropped_current_frame = false;
-
     /* FIXME/XXX we must redisplay the last decoded picture (because
     * of potential vout updated, or filters update or SPU update)
     * For now a high update period is needed but it could be removed
@@ -1423,10 +1421,9 @@ static vlc_tick_t DisplayPicture(vout_thread_sys_t *vout)
             date_refresh = swap_next_pts - render_delay;
 
         // next frame will still need some waiting before display
-        dropped_current_frame = sys->displayed.current != NULL;
         render_now = false;
 
-        if (likely(dropped_current_frame))
+        if (likely(sys->displayed.current != NULL))
             picture_Release(sys->displayed.current);
         sys->displayed.current = next;
     }
@@ -1438,7 +1435,7 @@ static vlc_tick_t DisplayPicture(vout_thread_sys_t *vout)
         render_now = refresh;
     }
 
-    if (!first && !refresh && !dropped_current_frame) {
+    if (!first && !refresh && next == NULL) {
         // nothing changed, wait until the next deadline or a control
         vlc_tick_t max_deadline = vlc_tick_now() + VOUT_REDISPLAY_DELAY;
         return __MIN(date_refresh, max_deadline);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c57b9453df2beb71b1d1c3970d7e15f96da95416...dd8c8e03b631a51e1063c5908c39679ff2a2fc5e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c57b9453df2beb71b1d1c3970d7e15f96da95416...dd8c8e03b631a51e1063c5908c39679ff2a2fc5e
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list