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

GOUJON Évan goujon.evan at gmail.com
Mon Mar 28 13:13:10 CEST 2016


---
 lib/video.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/video.c b/lib/video.c
index b2c9b34..5738f3a 100644
--- a/lib/video.c
+++ b/lib/video.c
@@ -547,6 +547,16 @@ int libvlc_video_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, "video-es", i_track ) < 0 )
+            libvlc_printerr( "Unable to disable video track" );
+        else
+            i_ret = 0;
+        vlc_object_release( p_input_thread );
+        return i_ret;
+    }
+
     var_Change( p_input_thread, "video-es", VLC_VAR_GETCHOICES, &val_list, NULL );
     for( int i = 0; i < val_list.p_list->i_count; i++ )
     {
-- 
2.5.0



More information about the vlc-devel mailing list