changeset 36706:8ca87345a6c2

Add language to VOBsub subtitle track information.
author ib
date Fri, 07 Feb 2014 19:23:09 +0000
parents 5697842046d2
children ebdf2390b935
files gui/dialog/menu.c
diffstat 1 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gui/dialog/menu.c	Fri Feb 07 19:16:22 2014 +0000
+++ b/gui/dialog/menu.c	Fri Feb 07 19:23:09 2014 +0000
@@ -26,6 +26,8 @@
 #include "mixer.h"
 #include "mpcommon.h"
 #include "mp_core.h"
+#include "sub/sub.h"
+#include "sub/vobsub.h"
 
 #include "menu.h"
 #include "dialog.h"
@@ -671,8 +673,20 @@
     for ( i=0;i < global_sub_size;i++ )
      {
       int ret = -1;
-      char lng[32], tmp[64];
-      if ( i >= subs0 + subs1 )
+      char lng[32], tmp[64], *lang;
+      /* VOBsub */
+      if ( ( i >= subs0 && i < subs0 + subs1 ) && vo_vobsub )
+       {
+        lang = vobsub_get_id( vo_vobsub, vobsub_get_id_by_index( vo_vobsub, i - subs0 ) );
+
+        if ( lang )
+         {
+          av_strlcpy( lng, lang, sizeof(lng) );
+          ret = 0;
+         }
+       }
+      /* embedded (demuxer) */
+      else if ( i >= subs0 + subs1 )
        {
         for ( j=0;j < MAX_S_STREAMS;j++ )
          {