changeset 19646:e6cdf80eb941

ass-color and ass-border-color options. Only plain text subtitles are affected.
author eugeni
date Sun, 03 Sep 2006 12:18:49 +0000
parents da6ec282d26c
children 41f24d1ec38e
files DOCS/man/en/mplayer.1 cfg-common.h libass/ass_mp.c libass/ass_mp.h
diffstat 4 files changed, 24 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1	Sun Sep 03 10:10:57 2006 +0000
+++ b/DOCS/man/en/mplayer.1	Sun Sep 03 12:18:49 2006 +0000
@@ -1759,11 +1759,19 @@
 You may also want to use \-embeddedfonts.
 .
 .TP
+.B \-ass-border-color <value>
+Sets border (outline) color for plain text subtitles. Color format is RRGGBBAA.
+.
+.TP
 .B \-ass-bottom-margin <value>
 Adds a black band at the bottom of the frame.
 The SSA/ASS renderer can place subtitles there (with \-ass-use-margins).
 .
 .TP
+.B \-ass-color <value>
+Sets color for plain text subtitles. Color format is RRGGBBAA.
+.
+.TP
 .B \-ass-font-scale <value>
 Set the scale coefficient to be used for fonts in the SSA/ASS renderer.
 .
--- a/cfg-common.h	Sun Sep 03 10:10:57 2006 +0000
+++ b/cfg-common.h	Sun Sep 03 12:18:49 2006 +0000
@@ -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},
--- a/libass/ass_mp.c	Sun Sep 03 10:10:57 2006 +0000
+++ b/libass/ass_mp.c	Sun Sep 03 12:18:49 2006 +0000
@@ -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;
--- a/libass/ass_mp.h	Sun Sep 03 10:10:57 2006 +0000
+++ b/libass/ass_mp.h	Sun Sep 03 12:18:49 2006 +0000
@@ -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);