Commit c7b874c5 authored by Jean-Philippe Andre's avatar Jean-Philippe Andre
Browse files

Fix segfault: press Shift+A without an opened AOUT would crash.

parent d4799c27
...@@ -162,6 +162,7 @@ static void Close( vlc_object_t *p_this ) ...@@ -162,6 +162,7 @@ static void Close( vlc_object_t *p_this )
static void Run( intf_thread_t *p_intf ) static void Run( intf_thread_t *p_intf )
{ {
vout_thread_t *p_vout = NULL; vout_thread_t *p_vout = NULL;
aout_instance_t *p_aout = NULL;
vlc_value_t val; vlc_value_t val;
playlist_t *p_playlist = pl_Hold( p_intf ); playlist_t *p_playlist = pl_Hold( p_intf );
int canc = vlc_savecancel(); int canc = vlc_savecancel();
...@@ -194,6 +195,9 @@ static void Run( intf_thread_t *p_intf ) ...@@ -194,6 +195,9 @@ static void Run( intf_thread_t *p_intf )
p_last_vout = p_vout; p_last_vout = p_vout;
p_vout = p_input ? input_GetVout( p_input ) : NULL; p_vout = p_input ? input_GetVout( p_input ) : NULL;
/* Update the aout */
p_aout = p_input ? input_GetAout( p_input ) : NULL;
/* Register OSD channels */ /* Register OSD channels */
if( p_vout && p_vout != p_last_vout ) if( p_vout && p_vout != p_last_vout )
{ {
...@@ -371,13 +375,11 @@ static void Run( intf_thread_t *p_intf ) ...@@ -371,13 +375,11 @@ static void Run( intf_thread_t *p_intf )
playlist_Play( p_playlist ); playlist_Play( p_playlist );
} }
} }
else if( i_action == ACTIONID_AUDIODEVICE_CYCLE ) else if( ( i_action == ACTIONID_AUDIODEVICE_CYCLE ) && p_aout )
{ {
vlc_value_t val, list, list2; vlc_value_t val, list, list2;
int i_count, i; int i_count, i;
aout_instance_t *p_aout =
vlc_object_find( p_intf, VLC_OBJECT_AOUT, FIND_ANYWHERE );
var_Get( p_aout, "audio-device", &val ); var_Get( p_aout, "audio-device", &val );
var_Change( p_aout, "audio-device", VLC_VAR_GETCHOICES, var_Change( p_aout, "audio-device", VLC_VAR_GETCHOICES,
&list, &list2 ); &list, &list2 );
...@@ -417,7 +419,6 @@ static void Run( intf_thread_t *p_intf ) ...@@ -417,7 +419,6 @@ static void Run( intf_thread_t *p_intf )
vout_OSDMessage( p_intf, DEFAULT_CHAN, vout_OSDMessage( p_intf, DEFAULT_CHAN,
_("Audio Device: %s"), _("Audio Device: %s"),
list2.p_list->p_values[i].psz_string); list2.p_list->p_values[i].psz_string);
vlc_object_release( p_aout );
} }
/* Input options */ /* Input options */
else if( p_input ) else if( p_input )
...@@ -912,6 +913,8 @@ static void Run( intf_thread_t *p_intf ) ...@@ -912,6 +913,8 @@ static void Run( intf_thread_t *p_intf )
} }
} }
} }
if( p_aout )
vlc_object_release( p_aout );
if( p_vout ) if( p_vout )
vlc_object_release( p_vout ); vlc_object_release( p_vout );
if( p_input ) if( p_input )
......
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