1
mirror of https://github.com/mpv-player/mpv synced 2025-01-01 04:36:24 +01:00

Support ScaledBorderAndShadow property.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28820 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
greg 2009-03-05 20:36:48 +00:00
parent a2b82120c0
commit 2432bbd43d
5 changed files with 19 additions and 1 deletions

View File

@ -520,6 +520,8 @@ static int process_info_line(ass_track_t* track, char *str)
track->Timer = atof(str + 6);
} else if (!strncmp(str,"WrapStyle:", 10)) {
track->WrapStyle = atoi(str + 10);
} else if (!strncmp(str, "ScaledBorderAndShadow:", 22)) {
track->ScaledBorderAndShadow = parse_bool(str + 22);
}
return 0;
}

View File

@ -2233,7 +2233,10 @@ static int ass_start_frame(ass_renderer_t *priv, ass_track_t* track, long long n
frame_context.font_scale = global_settings->font_size_coeff *
frame_context.orig_height / frame_context.track->PlayResY;
frame_context.border_scale = ((double)frame_context.orig_height) / frame_context.track->PlayResY;
if (frame_context.track->ScaledBorderAndShadow)
frame_context.border_scale = ((double)frame_context.orig_height) / frame_context.track->PlayResY;
else
frame_context.border_scale = 1.;
frame_context.font_scale_x = 1.;

View File

@ -105,6 +105,7 @@ typedef struct ass_track_s {
int PlayResY;
double Timer;
int WrapStyle;
char ScaledBorderAndShadow;
int default_style; // index of default style

View File

@ -96,6 +96,17 @@ int strtocolor(char** q, uint32_t* res)
return result;
}
// Return a boolean value for a string
char parse_bool(char* str) {
while (*str == ' ' || *str == '\t')
str++;
if (!strncasecmp(str, "yes", 3))
return 1;
else if (strtol(str, NULL, 10) > 0)
return 1;
return 0;
}
#if 0
static void sprint_tag(uint32_t tag, char* dst)
{

View File

@ -30,6 +30,7 @@ int mystrtoll(char** p, long long* res);
int mystrtou32(char** p, int base, uint32_t* res);
int mystrtod(char** p, double* res);
int strtocolor(char** q, uint32_t* res);
char parse_bool(char* str);
static inline int d6_to_int(int x) {
return (x + 32) >> 6;