[vlc-commits] input: ensure that viewpoint structs are read only from callbacks

Thomas Guillem git at videolan.org
Tue Jul 25 16:42:58 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jul 25 14:17:10 2017 +0200| [67e1dabcaa92d4051fc43e9cb21d0f990e3016e1] | committer: Thomas Guillem

input: ensure that viewpoint structs are read only from callbacks

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=67e1dabcaa92d4051fc43e9cb21d0f990e3016e1
---

 src/input/input.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/input/input.c b/src/input/input.c
index 428f05e29d..ae5fe03f81 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1986,6 +1986,9 @@ static bool Control( input_thread_t *p_input,
             for( size_t i = 0; i < i_vout; ++i )
             {
                 var_SetAddress( pp_vout[i], "viewpoint", &priv->viewpoint );
+                /* This variable can only be read from callbacks */
+                var_Change( pp_vout[i], "viewpoint", VLC_VAR_SETVALUE,
+                            &(vlc_value_t) { .p_address = NULL }, NULL );
                 vlc_object_release( pp_vout[i] );
             }
             free( pp_vout );
@@ -1995,6 +1998,9 @@ static bool Control( input_thread_t *p_input,
             {
 
                 var_SetAddress( p_aout, "viewpoint", &priv->viewpoint );
+                /* This variable can only be read from callbacks */
+                var_Change( p_aout, "viewpoint", VLC_VAR_SETVALUE,
+                            &(vlc_value_t) { .p_address = NULL }, NULL );
                 vlc_object_release( p_aout );
             }
             break;



More information about the vlc-commits mailing list