[vlc-commits] vout: use display date for subpicture_updater_t

Thomas Guillem git at videolan.org
Tue Apr 16 17:36:56 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Apr 16 17:32:06 2019 +0200| [8611210dae6248ce01594a922d6e77d3bb41e724] | committer: Thomas Guillem

vout: use display date for subpicture_updater_t

This fixes rendering of SPUs using a subpicture_updater_t

Regression from cc52435296404a526e239f0b3323a3651f45987a

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8611210dae6248ce01594a922d6e77d3bb41e724
---

 src/video_output/vout_subpictures.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index f32a5bd267..6b106534d3 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -1683,10 +1683,25 @@ subpicture_t *spu_Render(spu_t *spu,
 
     /* Updates the subpictures */
     for (size_t i = 0; i < subpicture_count; i++) {
-        subpicture_t *subpic = subpicture_array[i].subpicture;
+        spu_render_entry_t *entry = &subpicture_array[i];
+        subpicture_t *subpic = entry->subpicture;
+        if (!subpic->updater.pf_validate)
+            continue;
+
+        const vlc_tick_t i_original_start = subpic->i_start;
+        const vlc_tick_t i_original_stop = subpic->i_stop;
+
+        /* The subpicture_updater_t API expect display date */
+        subpic->i_start = entry->start;
+        subpic->i_stop = entry->stop;
         subpicture_Update(subpic,
                           fmt_src, fmt_dst,
                           subpic->b_subtitle ? render_subtitle_date : system_now);
+
+        /* Restore original dates, otherwise, the next call to
+         * SpuSelectSubpictures() won't be able to select this subtitle */
+        subpic->i_start = i_original_start;
+        subpic->i_stop = i_original_stop;
     }
 
     /* Now order the subpicture array



More information about the vlc-commits mailing list