[MPlayer-cvslog] CVS: main mplayer.c,1.840,1.841

Jindrich Makovicka CVS syncmail at mplayerhq.hu
Fri Apr 15 14:14:27 CEST 2005


CVS change done by Jindrich Makovicka CVS

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

Modified Files:
	mplayer.c 
Log Message:
Fix OSD when switching subtitles - set the osd buffer to Subtitle: off
first, and then eventually set it to other values if some kind of subtitles
is on. Otherwise 1) spudec stuff stomps on the buffer after vobsub, 2)
Subtitle: off isn't displayed when cycling text subtitles.


Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.840
retrieving revision 1.841
diff -u -r1.840 -r1.841
--- mplayer.c	11 Apr 2005 21:26:13 -0000	1.840
+++ mplayer.c	15 Apr 2005 12:14:24 -0000	1.841
@@ -3910,16 +3910,15 @@
 	  osd_show_sub_visibility--;
       } else
       if (osd_show_vobsub_changed) {
+	  snprintf(osd_text_tmp, 63, "Subtitles: off");
 	  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");
+	      snprintf(osd_text_tmp, 63, "Subtitles: (%d) %s", vobsub_id, language ? language : "unknown");
 	  }
 #ifdef HAVE_OGGVORBIS
 	  if (d_dvdsub && demuxer->type == DEMUXER_TYPE_OGG) {
-	      if (dvdsub_id < 0)
-		snprintf(osd_text_tmp, 63, "Subtitles: (off)");
-	      else {
+	      if (dvdsub_id >= 0) {
 		char *lang = demux_ogg_sub_lang(demuxer, dvdsub_id);
 		if (!lang) lang = "unknown";
 		snprintf(osd_text_tmp, 63, "Subtitles: (%d) %s", dvdsub_id, lang);
@@ -3928,15 +3927,17 @@
 #endif
 #ifdef USE_DVDREAD
 	  if (vo_spudec && (demuxer->type != DEMUXER_TYPE_MATROSKA)) {
-	      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;
+	      if (dvdsub_id >= 0) {
+		  char lang[5] = "none";
+		  int code = 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);
 	      }
-	      snprintf(osd_text_tmp, 63, "Subtitles: (%d) %s", dvdsub_id, lang);
 	  }
 #endif
 #ifdef HAVE_MATROSKA
@@ -3945,9 +3946,8 @@
       if (dvdsub_id >= 0) {
         demux_mkv_get_sub_lang(demuxer, dvdsub_id, lang, 9);
         lang[9] = 0;
-      } else
-        strcpy(lang, "off");
-      snprintf(osd_text_tmp, 63, "Subtitles: (%d) %s", dvdsub_id, lang);
+	snprintf(osd_text_tmp, 63, "Subtitles: (%d) %s", dvdsub_id, lang);
+      }
     }
 #endif
 	  osd_show_vobsub_changed--;




More information about the MPlayer-cvslog mailing list