[MPlayer-cvslog] r19652 - in trunk: DOCS/man/en/mplayer.1 cfg-common.h libass/ass_mp.c libass/ass_mp.h

eugeni subversion at mplayerhq.hu
Sun Sep 3 14:18:49 CEST 2006


Author: eugeni
Date: Sun Sep  3 14:18:49 2006
New Revision: 19652

Modified:
   trunk/cfg-common.h
   trunk/libass/ass_mp.c
   trunk/libass/ass_mp.h

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/man/en/mplayer.1

Log:
ass-color and ass-border-color options.
Only plain text subtitles are affected.


Modified: trunk/cfg-common.h
==============================================================================
--- trunk/cfg-common.h	(original)
+++ trunk/cfg-common.h	Sun Sep  3 14:18:49 2006
@@ -316,6 +316,8 @@
 	{"embeddedfonts", &extract_embedded_fonts, CONF_TYPE_FLAG, 0, 0, 1, NULL},
 	{"noembeddedfonts", &extract_embedded_fonts, CONF_TYPE_FLAG, 0, 1, 0, NULL},
 	{"ass-force-style", &ass_force_style_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
+	{"ass-color", &ass_color, CONF_TYPE_STRING, 0, 0, 0, NULL},
+	{"ass-border-color", &ass_border_color, CONF_TYPE_STRING, 0, 0, 0, NULL},
 #endif
 #ifdef HAVE_FONTCONFIG
 	{"fontconfig", &font_fontconfig, CONF_TYPE_FLAG, 0, 0, 1, NULL},

Modified: trunk/libass/ass_mp.c
==============================================================================
--- trunk/libass/ass_mp.c	(original)
+++ trunk/libass/ass_mp.c	Sun Sep  3 14:18:49 2006
@@ -5,6 +5,7 @@
 #include "mp_msg.h"
 
 #include "ass.h"
+#include "ass_utils.h"
 #include "ass_mp.h"
 
 // libass-related command line options
@@ -16,6 +17,8 @@
 int extract_embedded_fonts = 0;
 char **ass_force_style_list = NULL;
 int ass_use_margins = 0;
+char* ass_color = NULL;
+char* ass_border_color = NULL;
 
 extern int font_fontconfig;
 extern char* font_name;
@@ -30,6 +33,7 @@
 	ass_style_t* style;
 	int sid;
 	double fs;
+	uint32_t c1, c2;
 
 	track->track_type = TRACK_TYPE_ASS;
 	track->Timer = 100.;
@@ -50,9 +54,14 @@
 		fs *= 1.4;
 	style->FontSize = fs;
 
-	style->PrimaryColour = 0xFFFF0000;
-	style->SecondaryColour = 0xFFFF0000;
-	style->OutlineColour = 0x00000000;
+	if (ass_color) c1 = strtoll(ass_color, NULL, 16);
+	else c1 = 0xFFFF0000;
+	if (ass_border_color) c2 = strtoll(ass_border_color, NULL, 16);
+	else c2 = 0x00000000;
+
+	style->PrimaryColour = c1;
+	style->SecondaryColour = c1;
+	style->OutlineColour = c2;
 	style->BackColour = 0x00000000;
 	style->BorderStyle = 1;
 	style->Alignment = 2;

Modified: trunk/libass/ass_mp.h
==============================================================================
--- trunk/libass/ass_mp.h	(original)
+++ trunk/libass/ass_mp.h	Sun Sep  3 14:18:49 2006
@@ -11,6 +11,8 @@
 extern int extract_embedded_fonts;
 extern char **ass_force_style_list;
 extern int ass_use_margins;
+extern char* ass_color;
+extern char* ass_border_color;
 
 ass_track_t* ass_default_track();
 int ass_process_subtitle(ass_track_t* track, subtitle* sub);



More information about the MPlayer-cvslog mailing list