Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Aug 2013 01:06:19 GMT
From:      Cam Karnes <karnes.cameron@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/181596: [PATCH] Add subtitle, video, and audio track scrolling to VLC's ncurses.c module
Message-ID:  <201308280106.r7S16JVk024812@oldred.freebsd.org>
Resent-Message-ID: <201308280110.r7S1A0jq045671@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         181596
>Category:       ports
>Synopsis:       [PATCH] Add subtitle, video, and audio track scrolling to VLC's ncurses.c module
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 28 01:10:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Cam Karnes
>Release:        9.1-RELEASE
>Organization:
>Environment:
>Description:
A recent patch to the ncurses interface module (ncurses.c) enables scrolling through subtitle, audio, and video tracks. While I realize VLC 2.0.8 is already out, and the VLC port team is probably working to get it up to the most recent version, the patch was not implemented in the latest module. I find the patch significantly useful, as will others who enjoy both foreign film and the console interface.

A link to the original commit from Rafaël Carré <funman@videolan.org>: http://git.videolan.org/gitweb.cgi/vlc.git/?p=vlc.git;a=commit;h=e6c890d1f9db3517645e5bb23a9f6c4c6c88a66c
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- modules/gui/ncurses.c.orig
+++ modules/gui/ncurses.c
@@ -880,6 +880,9 @@ static int DrawHelp(intf_thread_t *intf)
     H(_(" s                      Stop"));
     H(_(" <space>                Pause/Play"));
     H(_(" f                      Toggle Fullscreen"));
+    H(_(" c                      Cycle through audio tracks"));
+    H(_(" v                      Cycle through subtitles tracks"));
+    H(_(" b                      Cycle through video tracks"));
     H(_(" n, p                   Next/Previous playlist item"));
     H(_(" [, ]                   Next/Previous title"));
     H(_(" <, >                   Next/Previous chapter"));
@@ -1543,6 +1546,30 @@ static void InputNavigate(input_thread_t* p_input, const char *var)
         var_TriggerCallback(p_input, var);
 }
 
+static void CycleESTrack(intf_sys_t *sys, const char *var)
+{
+    input_thread_t *input = sys->p_input;
+
+    if (!input)
+        return;
+
+    vlc_value_t val;
+    if (var_Change(input, var, VLC_VAR_GETLIST, &val, NULL) < 0)
+        return;
+
+    vlc_list_t *list = val.p_list;
+    int64_t current = var_GetInteger(input, var);
+
+    int i;
+    for (i = 0; i < list->i_count; i++)
+        if (list->p_values[i].i_int == current)
+            break;
+
+    if (++i >= list->i_count)
+        i = 0;
+    var_SetInteger(input, var, list->p_values[i].i_int);
+}
+
 static void HandleCommonKey(intf_thread_t *intf, int key)
 {
     intf_sys_t *sys = intf->p_sys;
@@ -1611,6 +1638,10 @@ static void HandleCommonKey(intf_thread_t *intf, int key)
     case 'z': playlist_VolumeDown(p_playlist, 1, NULL); break;
     case 'm': playlist_MuteToggle(p_playlist); break;
 
+    case 'c': CycleESTrack(sys, "audio-es"); break;
+    case 'v': CycleESTrack(sys, "spu-es");   break;
+    case 'b': CycleESTrack(sys, "video-es"); break;
+
     case 0x0c:  /* ^l */
     case KEY_CLEAR:
         break;
-- 
1.7.10.4



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308280106.r7S16JVk024812>