[MPlayer-cvslog] CVS: main/Gui/mplayer mw.c,1.118,1.119

Guillaume Poirier CVS syncmail at mplayerhq.hu
Sun Apr 16 18:58:38 CEST 2006


CVS change done by Guillaume Poirier CVS

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

Modified Files:
	mw.c 
Log Message:
Adds "cheap" subtitle switching for non-DVD playouts (for ex. OGG or MKV).
Patch by Stanislav Maslovski <stanislav POIS maslovski AH gmail POIS com>
Original thread:
Date: Apr 12, 2006 1:50 PM
Subject: [MPlayer-dev-eng] [PATCH] GUI: add cheap subtitle switching for non-DVD


Index: mw.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mw.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -r1.118 -r1.119
--- mw.c	27 Dec 2005 19:21:04 -0000	1.118
+++ mw.c	16 Apr 2006 16:58:36 -0000	1.119
@@ -32,6 +32,12 @@
 #include "widgets.h"
 
 extern mixer_t mixer; // mixer from mplayer.c
+extern int global_sub_size;
+extern int global_sub_pos;
+extern int global_sub_indices[];
+extern int sub_source(void);
+#define SUB_SOURCE_VOBSUB 1
+#define SUB_SOURCE_DEMUX  2
 
 extern unsigned int GetTimerMS( void );
 
@@ -110,6 +116,24 @@
 	video_id=iparam;
 	goto play;
 
+   case evSetSubtitle:
+	if ( !guiIntfStruct.demuxer || global_sub_pos == iparam ) break;
+	global_sub_pos = iparam;
+	if ( global_sub_pos >= 0 )
+	 switch ( sub_source() )
+	  {
+	   case SUB_SOURCE_VOBSUB:
+		vobsub_id = global_sub_pos - global_sub_indices[SUB_SOURCE_VOBSUB];
+		goto play;
+	   case SUB_SOURCE_DEMUX:
+		vobsub_id = -1;
+		dvdsub_id = global_sub_pos - global_sub_indices[SUB_SOURCE_DEMUX];
+		goto play;
+	  }
+	vobsub_id = -1;
+	dvdsub_id = -2;
+	goto play;
+
 #ifdef HAVE_VCD
    case evSetVCDTrack:
         guiIntfStruct.Track=iparam;




More information about the MPlayer-cvslog mailing list