[vlc-commits] vout_subpictures: compare against single order

Francois Cartegnie git at videolan.org
Mon Jan 6 18:39:30 CET 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Dec 23 17:00:00 2019 +0100| [8b38507bb45c2369eb5f2b09d96f61a15d86a232] | committer: Francois Cartegnie

vout_subpictures: compare against single order

only ephemer spu needs to be cleared by higher order spu.
stop values (non ephemer) must also be used to clear ephemers
from the same channel

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

 src/video_output/vout_subpictures.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index 1092b17593..71dc5e6648 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -677,8 +677,7 @@ spu_SelectSubpictures(spu_t *spu, vlc_tick_t system_now,
         vlc_tick_t   start_date = render_subtitle_date;
         vlc_tick_t   ephemer_subtitle_date = 0;
         vlc_tick_t   ephemer_osd_date = 0;
-        int64_t      ephemer_subtitle_order = INT64_MIN;
-        int64_t      ephemer_system_order = INT64_MIN;
+        int64_t      selected_max_order = INT64_MIN;
 
         if (spu_channel_UpdateDates(channel, system_now) == 0)
             continue;
@@ -696,11 +695,10 @@ spu_SelectSubpictures(spu_t *spu, vlc_tick_t system_now,
             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;
-            int64_t *ephemer_order_ptr = current->b_subtitle ? &ephemer_subtitle_order : &ephemer_system_order;
             if (current->i_start >= *date_ptr) {
                 *date_ptr = render_entry->start;
-                if (current->i_order > *ephemer_order_ptr)
-                    *ephemer_order_ptr = current->i_order;
+                if (current->i_order > selected_max_order)
+                    selected_max_order = current->i_order;
             }
 
             /* If the spu is ephemer, the stop time is invalid, but it has been converted to
@@ -737,7 +735,6 @@ spu_SelectSubpictures(spu_t *spu, vlc_tick_t system_now,
 
             const vlc_tick_t stop_date = current->b_subtitle ? __MAX(start_date, sys->last_sort_date) : system_now;
             const vlc_tick_t ephemer_date  = current->b_subtitle ? ephemer_subtitle_date  : ephemer_osd_date;
-            const int64_t ephemer_order = current->b_subtitle ? ephemer_subtitle_order : ephemer_system_order;
 
             /* Destroy late and obsolete ephemer subpictures */
             bool is_rejeted = is_late && render_entry->stop  <= stop_date;
@@ -745,7 +742,7 @@ spu_SelectSubpictures(spu_t *spu, vlc_tick_t system_now,
                 if (render_entry->start < ephemer_date)
                     is_rejeted = true;
                 else if (render_entry->start == ephemer_date &&
-                         current->i_order < ephemer_order)
+                         current->i_order < selected_max_order)
                     is_rejeted = true;
             }
 



More information about the vlc-commits mailing list