[vlc-devel] [PATCH 2/6] vout: spu: use entries from spu_channel
Thomas Guillem
thomas at gllm.fr
Thu Jun 6 15:19:26 CEST 2019
Instead of using one that is allocated in the stack.
This very small optim will allow to use one less allocation when entries will
be allocated in the heap.
---
src/video_output/vout_subpictures.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index ed0cf41d2b..11a552e1c3 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -567,8 +567,7 @@ static int SpuRenderCmp(const void *s0, const void *s1)
}
static int spu_channel_ConvertDates(struct spu_channel *channel,
- vlc_tick_t system_now,
- spu_render_entry_t *render_entries)
+ vlc_tick_t system_now)
{
/* Put every spu start and stop ts into the same array to convert them in
* one shot */
@@ -597,8 +596,8 @@ static int spu_channel_ConvertDates(struct spu_channel *channel,
entry_count = 0;
for (size_t index = 0; index < VOUT_MAX_SUBPICTURES; index++)
{
- spu_render_entry_t *render_entry = &render_entries[index];
- subpicture_t *current = channel->entries[index].subpic;
+ spu_render_entry_t *render_entry = &channel->entries[index];
+ subpicture_t *current = render_entry->subpic;
if (!current)
render_entry->subpic = NULL;
@@ -644,7 +643,7 @@ spu_SelectSubpictures(spu_t *spu, vlc_tick_t system_now,
for (size_t i = 0; i < sys->channels.size; i++)
{
struct spu_channel *channel = &sys->channels.data[i];
- spu_render_entry_t render_entries[VOUT_MAX_SUBPICTURES];
+ spu_render_entry_t *render_entries = channel->entries;
spu_render_entry_t available_entries[VOUT_MAX_SUBPICTURES];
bool is_available_late[VOUT_MAX_SUBPICTURES];
size_t available_count = 0;
@@ -655,7 +654,7 @@ spu_SelectSubpictures(spu_t *spu, vlc_tick_t system_now,
int64_t ephemer_subtitle_order = INT64_MIN;
int64_t ephemer_system_order = INT64_MIN;
- if (spu_channel_ConvertDates(channel, system_now, render_entries) == 0)
+ if (spu_channel_ConvertDates(channel, system_now) == 0)
continue;
/* Select available pictures */
--
2.20.1
More information about the vlc-devel
mailing list