[MPlayer-cvslog] r21220 - trunk/stream/stream_dvdnav.c

nicodvb subversion at mplayerhq.hu
Sat Nov 25 16:00:13 CET 2006


Author: nicodvb
Date: Sat Nov 25 16:00:08 2006
New Revision: 21220

Modified:
   trunk/stream/stream_dvdnav.c

Log:
support for comma-separated language codes in -slang

Modified: trunk/stream/stream_dvdnav.c
==============================================================================
--- trunk/stream/stream_dvdnav.c	(original)
+++ trunk/stream/stream_dvdnav.c	Sat Nov 25 16:00:08 2006
@@ -466,8 +466,10 @@
 int dvdnav_sid_from_lang(stream_t *stream, unsigned char *language) {
   dvdnav_priv_t * priv=(dvdnav_priv_t*)stream->priv;
   uint8_t format, lg, k;
-  uint16_t lang, lcode = (language[0] << 8) | (language[1]);
+  uint16_t lang, lcode;
 
+  while(language && strlen(language)>=2) {
+  lcode = (language[0] << 8) | (language[1]);
   for(k=0; k<32; k++) {
     lg = dvdnav_get_spu_logical_stream(priv->dvdnav, k);
     if(lg == 0xff) continue;
@@ -476,6 +478,9 @@
       return k;
     }
   }
+  language += 2;
+  while(language[0]==',' || language[0]==' ') ++language;
+  }
   return -1;
 }
 



More information about the MPlayer-cvslog mailing list