[vlc-commits] [Git][videolan/vlc][master] 3 commits: vout_subpictures: assert the render date is valid in spu_render_entry_IsSelected()
Steve Lhomme (@robUx4)
gitlab at videolan.org
Wed Apr 3 14:11:19 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
4e8eec47 by Steve Lhomme at 2024-04-03T13:36:06+00:00
vout_subpictures: assert the render date is valid in spu_render_entry_IsSelected()
It's either "system now" or a non paused timestamp from the clock.
Then we can simplify the last return.
- - - - -
e290b90a by Steve Lhomme at 2024-04-03T13:36:06+00:00
vout_subpictures: call spu_render_entry_IsSelected() consistently
- - - - -
b6445530 by Steve Lhomme at 2024-04-03T13:36:06+00:00
vout_subpictures: avoid local variable
- - - - -
1 changed file:
- src/video_output/vout_subpictures.c
Changes:
=====================================
src/video_output/vout_subpictures.c
=====================================
@@ -808,9 +808,9 @@ spu_render_entry_IsSelected(spu_render_entry_t *render_entry, size_t channel_id,
if (ignore_osd && !subpic->b_subtitle)
return false;
- if (render_date && render_date < render_entry->start)
- return false; /* Too early, come back next monday */
- return true;
+ assert(render_date != VLC_TICK_INVALID);
+ // is it too early for this entry ?
+ return render_date >= render_entry->start;
}
/*****************************************************************************
@@ -897,11 +897,10 @@ spu_SelectSubpictures(spu_t *spu, vlc_tick_t system_now,
for (size_t index = 0; index < channel->entries.size; ) {
render_entry = &channel->entries.data[index];
subpicture_t *current = render_entry->subpic;
- bool is_late = render_entry->is_late;
+ const vlc_tick_t render_date = current->b_subtitle ? render_subtitle_date : system_now;
if (!spu_render_entry_IsSelected(render_entry, channel->id,
- current->b_subtitle ? render_subtitle_date : system_now,
- ignore_osd))
+ render_date, ignore_osd))
{
index++;
continue;
@@ -910,7 +909,7 @@ 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;
/* Destroy late and obsolete ephemer subpictures */
- bool is_rejected = is_late && render_entry->stop <= stop_date;
+ bool is_rejected = render_entry->is_late && render_entry->stop <= stop_date;
if (current->b_ephemer) {
const vlc_tick_t ephemer_date = current->b_subtitle ? ephemer_subtitle_date : ephemer_osd_date;
if (render_entry->start < ephemer_date)
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/af826f4a02b31dabe0ab05d50e9a5c17555c4fe6...b64455307a5a06cb19d30974b909e143f6ae6abe
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/af826f4a02b31dabe0ab05d50e9a5c17555c4fe6...b64455307a5a06cb19d30974b909e143f6ae6abe
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