[Mplayer-cvslog] CVS: main cfg-mplayer.h,1.163,1.164 mplayer.c,1.567,1.568 subreader.c,1.68,1.69 subreader.h,1.17,1.18

Kim Minh Kaplan CVS kmkaplan at mplayerhq.hu
Sat Sep 21 19:24:00 CEST 2002


Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv29284

Modified Files:
	cfg-mplayer.h mplayer.c subreader.c subreader.h 
Log Message:
New option for mplayer: -dumpmicrodvdsub


Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -r1.163 -r1.164
--- cfg-mplayer.h	20 Sep 2002 18:54:22 -0000	1.163
+++ cfg-mplayer.h	21 Sep 2002 17:23:46 -0000	1.164
@@ -328,6 +328,7 @@
 	{"dumpmpsub", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 4, NULL},
 	{"dumpstream", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 5, NULL},
 	{"dumpsrtsub", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 6, NULL},
+	{"dumpmicrodvdsub", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 7, NULL},
 
 #ifdef HAVE_LIRC
 	{"lircconf", &lirc_configfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, 

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.567
retrieving revision 1.568
diff -u -r1.567 -r1.568
--- mplayer.c	20 Sep 2002 18:54:22 -0000	1.567
+++ mplayer.c	21 Sep 2002 17:23:46 -0000	1.568
@@ -1204,6 +1204,7 @@
   if(subtitles && stream_dump_type==3) list_sub_file(subtitles);
   if(subtitles && stream_dump_type==4) dump_mpsub(subtitles, sh_video->fps);
   if(subtitles && stream_dump_type==6) dump_srt(subtitles, sh_video->fps);
+  if(subtitles && stream_dump_type==7) dump_microdvd(subtitles, sh_video->fps);
 }
 #endif
 

Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- subreader.c	28 Aug 2002 23:00:24 -0000	1.68
+++ subreader.c	21 Sep 2002 17:23:46 -0000	1.69
@@ -1007,6 +1007,40 @@
 	mp_msg(MSGT_SUBREADER,MSGL_INFO,"SUB: Subtitles dumped in \'dump.mpsub\'.\n");
 }
 
+void dump_microdvd(subtitle* subs, float fps) {
+    int i, delay;
+    FILE *fd;
+    if (sub_fps == 0)
+	sub_fps = fps;
+    fd = fopen("dumpsub.txt", "w");
+    if (!fd) {
+	perror("dumpsub.txt: fopen");
+	return;
+    }
+    delay = sub_delay * sub_fps;
+    for (i = 0; i < sub_num; ++i) {
+	int j, start, end;
+	start = subs[i].start;
+	end = subs[i].end;
+	if (sub_uses_time) {
+	    start = start * sub_fps / 100 ;
+	    end = end * sub_fps / 100;
+	}
+	else {
+	    start = start * sub_fps / fps;
+	    end = end * sub_fps / fps;
+	}
+	start -= delay;
+	end -= delay;
+	fprintf(fd, "{%d}{%d}", start, end);
+	for (j = 0; j < subs[i].lines; ++j) 
+	    fprintf(fd, "%s%s", j ? "|" : "", subs[i].text[j]);
+	fprintf(fd, "\n");
+    }
+    fclose(fd);
+    mp_msg(MSGT_SUBREADER,MSGL_INFO,"SUB: Subtitles dumped in \'dumpsub.txt\'.\n");
+}
+
 void sub_free( subtitle * subs )
 {
  int i;

Index: subreader.h
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- subreader.h	1 Sep 2002 11:08:28 -0000	1.17
+++ subreader.h	21 Sep 2002 17:23:46 -0000	1.18
@@ -40,6 +40,7 @@
 void list_sub_file(subtitle* subs);
 void dump_srt(subtitle* subs, float fps);
 void dump_mpsub(subtitle* subs, float fps);
+void dump_microdvd(subtitle* subs, float fps);
 void sub_free( subtitle * subs );
 void find_sub(subtitle* subtitles,int key);
 #endif




More information about the MPlayer-cvslog mailing list