[vlc-commits] vout: ensure expired subpictures are really deleted
Francois Cartegnie
git at videolan.org
Fri Nov 9 14:49:52 CET 2018
vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Nov 8 13:04:58 2018 +0100| [951dbeb6f9cc4efc9df3feb5e3427775f8b709f2] | committer: Francois Cartegnie
vout: ensure expired subpictures are really deleted
currently happens only when another subpicture is in the heap
and is valid
(cherry picked from commit a39eb8df51aeb4e6b568416896b2b0e4e7833e9f)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=951dbeb6f9cc4efc9df3feb5e3427775f8b709f2
---
include/vlc_vout.h | 1 +
src/video_output/vout_subpictures.c | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/vlc_vout.h b/include/vlc_vout.h
index 9987404022..627f6cec2e 100644
--- a/include/vlc_vout.h
+++ b/include/vlc_vout.h
@@ -153,6 +153,7 @@ VLC_API picture_t * vout_GetPicture( vout_thread_t * );
VLC_API void vout_PutPicture( vout_thread_t *, picture_t * );
/* Subpictures channels ID */
+#define VOUT_SPU_CHANNEL_INVALID (-1) /* Always fails in comparison */
#define VOUT_SPU_CHANNEL_OSD 1 /* OSD channel is automatically cleared */
#define VOUT_SPU_CHANNEL_AVAIL_FIRST 8 /* Registerable channels from this offset */
diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index 1c6f90da84..41fe8d5159 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -550,6 +550,10 @@ static void SpuSelectSubpictures(spu_t *spu,
channel[channel_count++] = i_channel;
}
+ /* Ensure a 1 pass garbage collection for rejected subpictures */
+ if(channel_count == 0)
+ channel[channel_count++] = VOUT_SPU_CHANNEL_INVALID;
+
/* Fill up the subpicture_array arrays with relevant pictures */
for (int i = 0; i < channel_count; i++) {
subpicture_t *available_subpic[VOUT_MAX_SUBPICTURES];
@@ -1652,7 +1656,7 @@ void spu_ClearChannel(spu_t *spu, int channel)
if (subpic->i_channel != channel && (channel != -1 || subpic->i_channel == VOUT_SPU_CHANNEL_OSD))
continue;
- /* You cannot delete subpicture outside of spu_SortSubpictures */
+ /* You cannot delete subpicture outside of SpuSelectSubpictures */
entry->reject = true;
}
More information about the vlc-commits
mailing list