[vlc-devel] [PATCH] video_output: fix comment and move do_snapshot

Alexandre Janniaux ajanni at videolabs.io
Mon Mar 22 09:14:40 UTC 2021


The comment /* Get the subpicture to be displayed */ was written twice
in places where no subpictures were involved. In addition, do_snapshot
was computed where the rendering date was computed although it was not
used there.

Move the do_snapshot computation just before it's used, replace the
misplaced comments by comment actually describing what's follow, and
rewrite the removed comment where spu_Render actually returns the
subpicture.
---
 src/video_output/video_output.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 00dd9ac9ce..8db6746725 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1126,9 +1126,8 @@ static int ThreadDisplayRenderPicture(vout_thread_sys_t *vout, bool render_now)
     vlc_mutex_lock(&sys->display_lock);
 
     /*
-     * Get the subpicture to be displayed
+     * Get the rendering date for the current subpicture to be displayed.
      */
-    const bool do_snapshot = vout_snapshot_IsRequested(sys->snapshot);
     vlc_tick_t system_now = vlc_tick_now();
     vlc_tick_t render_subtitle_date;
     if (sys->pause.is_on)
@@ -1150,8 +1149,11 @@ static int ThreadDisplayRenderPicture(vout_thread_sys_t *vout, bool render_now)
     }
 
     /*
-     * Get the subpicture to be displayed
+     * Check whether we let the display draw the subpicture itself (when
+     * do_dr_spu=true), and if we can fallback to blending the subpicture
+     * ourselves (do_early_spu=true).
      */
+    const bool do_snapshot = vout_snapshot_IsRequested(sys->snapshot);
     const bool do_dr_spu = !do_snapshot &&
                            vd->info.subpicture_chromas &&
                            *vd->info.subpicture_chromas != 0;
@@ -1203,6 +1205,7 @@ static int ThreadDisplayRenderPicture(vout_thread_sys_t *vout, bool render_now)
         }
     }
 
+    /* Get the subpicture to be displayed. */
     video_format_t fmt_spu_rot;
     video_format_ApplyRotation(&fmt_spu_rot, &fmt_spu);
     subpicture_t *subpic = !sys->spu ? NULL :
-- 
2.31.0



More information about the vlc-devel mailing list