[vlc-commits] [Git][videolan/vlc][master] vout_subpictures: avoid converting invalid timestamps

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Jan 27 05:47:53 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
ae69d42e by Alaric Senat at 2025-01-27T05:32:50+00:00
vout_subpictures: avoid converting invalid timestamps

Ephemeral subtitles stop timestamps are often undefined. Converting them
with the clock can lead to unexpected behavior.

This fixes an assert failure with some ephemeral DVD SPUs:

> Assertion failed: ctx->wait_sync_ref.stream != VLC_TICK_INVALID, at: src/clock/clock.c,582

- - - - -


1 changed file:

- src/video_output/vout_subpictures.c


Changes:

=====================================
src/video_output/vout_subpictures.c
=====================================
@@ -779,10 +779,16 @@ static size_t spu_channel_UpdateDates(struct spu_channel *channel,
                                                  entry->orgstart, channel->rate,
                                                  NULL);
 
-        entry->stop =
-            vlc_clock_ConvertToSystem(channel->clock, system_now,
-                                      entry->orgstop, channel->rate,
-                                      NULL);
+        if (entry->orgstop != VLC_TICK_INVALID)
+        {
+            entry->stop = vlc_clock_ConvertToSystem(channel->clock,
+                                                    system_now,
+                                                    entry->orgstop,
+                                                    channel->rate,
+                                                    NULL);
+        }
+        else
+            entry->stop = VLC_TICK_INVALID;
     }
     vlc_clock_Unlock(channel->clock);
 
@@ -2133,9 +2139,13 @@ void spu_PutSubpicture(spu_t *spu, subpicture_t *subpic)
         subpic->i_start =
             vlc_clock_ConvertToSystem(channel->clock, system_now,
                                       orgstart, channel->rate, NULL);
-        subpic->i_stop =
-            vlc_clock_ConvertToSystem(channel->clock, system_now,
+        if (orgstop != VLC_TICK_INVALID)
+        {
+            subpic->i_stop =
+                vlc_clock_ConvertToSystem(channel->clock, system_now,
                                       orgstop, channel->rate, NULL);
+        }
+
         vlc_clock_Unlock(channel->clock);
 
         spu_channel_EarlyRemoveLate(sys, channel, system_now);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/ae69d42e44f979af075467a207eba97dff89d026

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/ae69d42e44f979af075467a207eba97dff89d026
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list