input: ensure that viewpoint structs are read only from callbacks
authorThomas Guillem <thomas@gllm.fr>
Tue, 25 Jul 2017 12:17:10 +0000 (14:17 +0200)
committerThomas Guillem <thomas@gllm.fr>
Tue, 25 Jul 2017 14:40:51 +0000 (16:40 +0200)
src/input/input.c

index 428f05e..ae5fe03 100644 (file)
@@ -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;