[Mplayer-cvslog] CVS: main mplayer.c,1.768,1.769

Joey Parrish CVS syncmail at mplayerhq.hu
Sun Aug 22 20:47:49 CEST 2004


CVS change done by Joey Parrish CVS

Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv15657

Modified Files:
	mplayer.c 
Log Message:
moved combined vobsub_lang into sub_select
add support for dvd subs and ogg subs into sub_select
document sub_select
vobsub_lang left as a link to sub_select for backwards compatibility


Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.768
retrieving revision 1.769
diff -u -r1.768 -r1.769
--- mplayer.c	12 Aug 2004 22:33:21 -0000	1.768
+++ mplayer.c	22 Aug 2004 18:47:47 -0000	1.769
@@ -1587,7 +1587,7 @@
 demux_info_print(demuxer);
 
 //================== Read SUBTITLES (DVD & TEXT) ==========================
-if(d_dvdsub->id >= 0 && vo_spudec==NULL && sh_video){
+if(vo_spudec==NULL && sh_video && stream->type==STREAMTYPE_DVD){
 
 if (spudec_ifo) {
   unsigned int palette[16], width, height;
@@ -3115,7 +3115,16 @@
 	}
 #endif
 	} break;
-    case MP_CMD_VOBSUB_LANG:
+    case MP_CMD_SUB_SELECT:
+#ifdef USE_SUB  
+    if (set_of_sub_size > 0){ //change subtitle file  
+        set_of_sub_pos = (set_of_sub_pos + 1) % set_of_sub_size;
+        subdata = set_of_subtitles[set_of_sub_pos];
+        osd_show_sub_changed = sh_video->fps;
+        vo_sub = NULL;
+        vo_osd_changed(OSDTYPE_SUBTITLE); 
+    }
+#endif
     if (vo_vobsub)
     {
 	int new_id = vobsub_id + 1;
@@ -3124,20 +3133,33 @@
 	if ((unsigned int) new_id >= vobsub_get_indexes_count(vo_vobsub))
 	    new_id = -1;
         if(new_id != vobsub_id)
-	    osd_show_vobsub_changed = 9;
+	    osd_show_vobsub_changed = sh_video->fps;
 	vobsub_id = new_id;
     }
-        break;
-    case MP_CMD_SUB_SELECT:
-#ifdef USE_SUB  
-    if (set_of_sub_size > 0){ //change subtitle file  
-        set_of_sub_pos = (set_of_sub_pos + 1) % set_of_sub_size;
-        subdata = set_of_subtitles[set_of_sub_pos];
-        osd_show_sub_changed = sh_video->fps;
-        vo_sub = NULL;
-        vo_osd_changed(OSDTYPE_SUBTITLE); 
+    if (vo_spudec && stream->type == STREAMTYPE_DVD)
+    {
+	int new_id = dvdsub_id + 1;
+	if (dvdsub_id < 0)
+	    new_id = 0;
+	if ((unsigned int) new_id >= dvd_number_of_subs(stream))
+	    new_id = -1;
+	if(new_id != dvdsub_id)
+	    osd_show_vobsub_changed = sh_video->fps;
+	d_dvdsub->id = dvdsub_id = new_id;
+	spudec_reset(vo_spudec);
+    }
+    if (d_dvdsub && demuxer->type == DEMUXER_TYPE_OGG)
+    {
+	int new_id = dvdsub_id + 1;
+	if (dvdsub_id < 0)
+	    new_id = 0;
+	if ((unsigned int) new_id >= demux_ogg_num_subs())
+	    new_id = -1;
+	if (new_id != dvdsub_id)
+	    osd_show_vobsub_changed = sh_video->fps;
+	dvdsub_id = new_id;
+	d_dvdsub->id = demux_ogg_sub_id(new_id);
     }
-#endif
         break;
     case MP_CMD_SUB_FORCED_ONLY:
       if (vo_spudec) {
@@ -3560,10 +3582,28 @@
 	  osd_show_sub_visibility--;
       } else
       if (osd_show_vobsub_changed) {
-	  const char *language = "none";
-	  if (vo_vobsub && vobsub_id >= 0)
+	  if (vo_vobsub && vobsub_id >= 0) {
+	      const char *language = "none";
 	      language = vobsub_get_id(vo_vobsub, (unsigned int) vobsub_id);
 	  snprintf(osd_text_tmp, 63, "Subtitles: (%d) %s", vobsub_id, language ? language : "unknown");
+	  }
+	  if (d_dvdsub && demuxer->type == DEMUXER_TYPE_OGG) {
+	      if (dvdsub_id < 0)
+		snprintf(osd_text_tmp, 63, "Subtitles: (off)");
+	      else
+		snprintf(osd_text_tmp, 63, "Subtitles: (%d)", dvdsub_id);
+	  }
+	  if (vo_spudec) {
+	      char lang[5] = "none";
+	      int code = 0;
+	      if (dvdsub_id >= 0) code = dvd_lang_from_sid(stream, dvdsub_id);
+	      if (code) {
+	         lang[0] = code >> 8;
+	         lang[1] = code;
+	         lang[2] = 0;
+	      }
+	      snprintf(osd_text_tmp, 63, "Subtitles: (%d) %s", dvdsub_id, lang);
+	  }
 	  osd_show_vobsub_changed--;
       } else
 #ifdef USE_SUB




More information about the MPlayer-cvslog mailing list