Commit f3968d65 authored by Damien Fouilleul's avatar Damien Fouilleul

libvlc/control: make sure aout is active before attempting to use channels

parent a5e5d59b
......@@ -217,11 +217,15 @@ int libvlc_audio_get_channel( libvlc_instance_t *p_instance,
libvlc_exception_t *p_e )
{
aout_instance_t *p_aout = GetAOut( p_instance, p_e );
if( p_aout )
{
vlc_value_t val;
var_Get( p_aout, "audio-channels", &val );
vlc_object_release( p_aout );
return val.i_int;
}
return -1;
}
/*****************************************************************************
......@@ -231,6 +235,8 @@ void libvlc_audio_set_channel( libvlc_instance_t *p_instance, int i_channel,
libvlc_exception_t *p_e )
{
aout_instance_t *p_aout = GetAOut( p_instance, p_e );
if( p_aout )
{
vlc_value_t val;
int i_ret = -1;
......@@ -256,4 +262,5 @@ void libvlc_audio_set_channel( libvlc_instance_t *p_instance, int i_channel,
break;
}
vlc_object_release( p_aout );
}
}
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