[MPlayer-cvslog] r21213 - in trunk/stream: stream_dvdnav.c stream_dvdnav.h

nicodvb subversion at mplayerhq.hu
Sat Nov 25 13:17:34 CET 2006


Author: nicodvb
Date: Sat Nov 25 13:17:34 2006
New Revision: 21213

Modified:
   trunk/stream/stream_dvdnav.c
   trunk/stream/stream_dvdnav.h

Log:
added code to identify subs language and count; needed for forthcoming support for -slang

Modified: trunk/stream/stream_dvdnav.c
==============================================================================
--- trunk/stream/stream_dvdnav.c	(original)
+++ trunk/stream/stream_dvdnav.c	Sat Nov 25 13:17:34 2006
@@ -476,6 +476,34 @@
   priv->mousey = y;
 }
 
+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]);
+
+  for(k=0; k<32; k++) {
+    lg = dvdnav_get_spu_logical_stream(priv->dvdnav, k);
+    if(lg == 0xff) continue;
+    lang = dvdnav_spu_stream_to_lang(priv->dvdnav, lg);
+    if(lang != 0xFFFF && lang == lcode) {
+      return k;
+    }
+  }
+  return -1;
+}
+
+int dvdnav_number_of_subs(stream_t *stream) {
+  dvdnav_priv_t * priv=(dvdnav_priv_t*)stream->priv;
+  uint8_t lg, k, n=0;
+
+  for(k=0; k<32; k++) {
+    lg = dvdnav_get_spu_logical_stream(priv->dvdnav, k);
+    if(lg == 0xff) continue;
+    n++;
+  }
+  return n;
+}
+
 
 stream_info_t stream_info_dvdnav = {
   "DVDNAV stream",

Modified: trunk/stream/stream_dvdnav.h
==============================================================================
--- trunk/stream/stream_dvdnav.h	(original)
+++ trunk/stream/stream_dvdnav.h	Sat Nov 25 13:17:34 2006
@@ -33,6 +33,8 @@
 extern int osd_show_dvd_nav_sy;
 extern int osd_show_dvd_nav_ey;
 
+int dvdnav_number_of_subs(stream_t *stream);
+int dvdnav_sid_from_lang(stream_t *stream, unsigned char *language);
 int mp_dvdnav_handle_input(stream_t *stream, int cmd, int *button);
 void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* button);
 



More information about the MPlayer-cvslog mailing list