Commit e8418dde authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* More fixes for the video-device selection on OSX. refs #702

  Attach the Callback before setting the value, if you depend on information being properly set by that callback
parent f2ecf48f
...@@ -173,11 +173,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -173,11 +173,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
p_real_vout = [VLCVoutView getRealVout: p_vout]; p_real_vout = [VLCVoutView getRealVout: p_vout];
/* Get the pref value when this is the first time, otherwise retrieve the device from the top level video-device var */ /* Get the pref value when this is the first time, otherwise retrieve the device from the top level video-device var */
if( var_Type( p_real_vout->p_vlc, "video-device" ) == 0 ) i_device = var_GetInteger( p_vout, "macosx-vdev" );
{ if( var_Type( p_real_vout->p_vlc, "video-device" ) != 0 )
i_device = var_GetInteger( p_vout, "macosx-vdev" );
}
else
{ {
i_device = var_GetInteger( p_real_vout->p_vlc, "video-device" ); i_device = var_GetInteger( p_real_vout->p_vlc, "video-device" );
} }
...@@ -201,6 +198,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -201,6 +198,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
var_Change( p_real_vout, "video-device", var_Change( p_real_vout, "video-device",
VLC_VAR_ADDCHOICE, &val2, &text ); VLC_VAR_ADDCHOICE, &val2, &text );
var_Set( p_real_vout, "video-device", val2 ); var_Set( p_real_vout, "video-device", val2 );
var_AddCallback( p_real_vout, "video-device", DeviceCallback, NULL );
while( (o_screen = [o_enumerator nextObject]) != NULL ) while( (o_screen = [o_enumerator nextObject]) != NULL )
{ {
...@@ -222,9 +220,6 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -222,9 +220,6 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
i++; i++;
} }
var_AddCallback( p_real_vout, "video-device", DeviceCallback,
NULL );
val2.b_bool = VLC_TRUE; val2.b_bool = VLC_TRUE;
var_Set( p_real_vout, "intf-change", val2 ); var_Set( p_real_vout, "intf-change", val2 );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment