[vlc-commits] [Git][videolan/vlc][master] 2 commits: vout: subpictures: select spu only against precomputed deadline

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Tue Jul 6 15:30:10 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
7c791b04 by Francois Cartegnie at 2021-07-06T12:57:52+00:00
vout: subpictures: select spu only against precomputed deadline

- - - - -
8f404311 by Francois Cartegnie at 2021-07-06T12:57:52+00:00
vout: subpicture: fix subtitles pause #24961

In case of paused subtitles, they are no longer selected
as clock returns INT64_MAX on pause.
The pause need to be dealt with at conversion time as it
can't be synchronized with pause_date freeze or prevented
from returning invalid before finishing spu_render.

- - - - -


1 changed file:

- src/video_output/vout_subpictures.c


Changes:

=====================================
src/video_output/vout_subpictures.c
=====================================
@@ -619,9 +619,11 @@ static size_t spu_channel_UpdateDates(struct spu_channel *channel,
     for (size_t index = 0; index < channel->entries.size; index++)
     {
         spu_render_entry_t *render_entry = &channel->entries.data[index];
-
-        render_entry->start = date_array[index * 2];
-        render_entry->stop = date_array[index * 2 + 1];
+        if(date_array[index * 2] != INT64_MAX) /* pause triggered before or during spu render */
+        {
+            render_entry->start = date_array[index * 2];
+            render_entry->stop = date_array[index * 2 + 1];
+        }
     }
 
     free(date_array);
@@ -630,8 +632,7 @@ static size_t spu_channel_UpdateDates(struct spu_channel *channel,
 
 static bool
 spu_render_entry_IsSelected(spu_render_entry_t *render_entry, size_t channel_id,
-                            vlc_tick_t system_now,
-                            vlc_tick_t render_subtitle_date, bool ignore_osd)
+                            vlc_tick_t render_date, bool ignore_osd)
 {
     subpicture_t *subpic = render_entry->subpic;
     assert(subpic);
@@ -642,9 +643,6 @@ spu_render_entry_IsSelected(spu_render_entry_t *render_entry, size_t channel_id,
     if (ignore_osd && !subpic->b_subtitle)
         return false;
 
-    const vlc_tick_t render_date =
-        subpic->b_subtitle ? render_subtitle_date : system_now;
-
     if (render_date && render_date < render_entry->start)
         return false; /* Too early, come back next monday */
     return true;
@@ -699,14 +697,12 @@ spu_SelectSubpictures(spu_t *spu, vlc_tick_t system_now,
         for (size_t index = 0; index < channel->entries.size; index++) {
             spu_render_entry_t *render_entry = &channel->entries.data[index];
             subpicture_t *current = render_entry->subpic;
+            const vlc_tick_t render_date = current->b_subtitle ? render_subtitle_date : system_now;
 
             if (!spu_render_entry_IsSelected(render_entry, channel->id,
-                                             system_now, render_subtitle_date,
-                                             ignore_osd))
+                                             render_date, ignore_osd))
                 continue;
 
-            const vlc_tick_t render_date = current->b_subtitle ? render_subtitle_date : system_now;
-
             vlc_tick_t *date_ptr  = current->b_subtitle ? &ephemer_subtitle_date  : &ephemer_osd_date;
             if (current->i_start >= *date_ptr) {
                 *date_ptr = render_entry->start;
@@ -744,7 +740,7 @@ spu_SelectSubpictures(spu_t *spu, vlc_tick_t system_now,
             bool is_late = render_entry->is_late;
 
             if (!spu_render_entry_IsSelected(render_entry, channel->id,
-                                             system_now, render_subtitle_date,
+                                             current->b_subtitle ? render_subtitle_date : system_now,
                                              ignore_osd))
             {
                 index++;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c882e2c8a7143a76f6239f333eaf9fb88dc9be76...8f40431177c87b1d29f088d32c2384716266551b

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




More information about the vlc-commits mailing list