[vlc-commits] spu: do nothing if input does not change
Rémi Denis-Courmont
git at videolan.org
Sat Jan 26 17:16:29 CET 2019
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jan 23 22:30:59 2019 +0200| [9124d96dfc1f6a85d49e2986f0d710198ae3bb2f] | committer: Rémi Denis-Courmont
spu: do nothing if input does not change
An input thread must be created before it is attached to the SPU,
and detached from the SPU before it is destroyed. As such, if the
already attached input pointer equals the newly attached input, we can
infer that it is actually the same input. That is then a no-op.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9124d96dfc1f6a85d49e2986f0d710198ae3bb2f
---
src/video_output/vout_subpictures.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index 2d72954c65..905159c143 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -1396,15 +1396,15 @@ void spu_Destroy(spu_t *spu)
void spu_Attach(spu_t *spu, input_thread_t *input)
{
vlc_mutex_lock(&spu->p->lock);
+ if (spu->p->input != input) {
+ UpdateSPU(spu, NULL);
- UpdateSPU(spu, NULL);
-
- spu->p->input = input;
-
- if (spu->p->text)
- FilterRelease(spu->p->text);
- spu->p->text = SpuRenderCreateAndLoadText(spu);
+ spu->p->input = input;
+ if (spu->p->text)
+ FilterRelease(spu->p->text);
+ spu->p->text = SpuRenderCreateAndLoadText(spu);
+ }
vlc_mutex_unlock(&spu->p->lock);
}
More information about the vlc-commits
mailing list