[vlc-devel] [PATCH 16/16] Fix OSD text not displayed if SPU clock exists

Roland Bewick roland.bewick at gmail.com
Tue May 21 20:08:40 CEST 2019


This fix is for an existing bug which causes OSD text not to show (OSD text that should be shown immediately gets converted to movie time)
---
 src/video_output/vout_subpictures.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index 9bd2abf2d3..f7b02784f8 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -607,12 +607,21 @@ static int SpuConvertDates(spu_t *spu, vlc_tick_t system_now,
             render_entry->subpicture = NULL;
         else
         {
-            int clock_index = SpuGetClockIndex(spu, current->p_clock);
             render_entry->subpicture = current;
-            render_entry->start =
-                date_array[clock_index][entry_count * 2];
-            render_entry->stop =
-                date_array[clock_index][entry_count * 2 + 1];
+
+            if (current->b_subtitle)
+            {
+                int clock_index = SpuGetClockIndex(spu, current->p_clock);
+                render_entry->start = date_array[clock_index][entry_count * 2];
+                render_entry->stop = date_array[clock_index][entry_count * 2 + 1];
+            }
+            else
+            {
+                /* Don't use clock time for OSD text */
+                render_entry->start = current->i_start;
+                render_entry->stop = current->i_stop;
+            }
+
             entry_count++;
         }
     }
-- 
2.11.0



More information about the vlc-devel mailing list