[vlc-devel] [PATCH 1/2] lib/audio: Disable audio track if requested

Rémi Denis-Courmont remi at remlab.net
Tue Mar 29 15:05:28 CEST 2016


Le 2016-03-28 13:13, GOUJON Évan a écrit :
> ---
>  lib/audio.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/lib/audio.c b/lib/audio.c
> index 7901c64..03a5df4 100644
> --- a/lib/audio.c
> +++ b/lib/audio.c
> @@ -419,6 +419,16 @@ int libvlc_audio_set_track(
> libvlc_media_player_t *p_mi, int i_track )
>      if( !p_input_thread )
>          return -1;
>
> +    if( i_track == -1 )
> +    {
> +        if( var_SetInteger( p_input_thread, "audio-es", i_track ) < 
> 0 )
> +            libvlc_printerr( "Unable to disable sound track" );
> +        else
> +            i_ret = 0;
> +        vlc_object_release( p_input_thread );
> +        return i_ret;
> +    }
> +

Did you actually test the error case? Seems bizarre.

>      var_Change( p_input_thread, "audio-es", VLC_VAR_GETCHOICES,
> &val_list, NULL );
>      for( int i = 0; i < val_list.p_list->i_count; i++ )
>      {

-- 
Rémi Denis-Courmont
http://www.remlab.net/


More information about the vlc-devel mailing list