summaryrefslogtreecommitdiffstats
path: root/spudec.c
diff options
context:
space:
mode:
authorpl <pl@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-20 21:45:07 +0000
committerpl <pl@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-20 21:45:07 +0000
commitba1e0116859530aa9f683eccb9ca765d9c8cf8dc (patch)
tree298146c64382ca93e10699447d0c6780c800a030 /spudec.c
parent6220f955b33cfca403969259ef420827262f79c4 (diff)
downloadmpv-ba1e0116859530aa9f683eccb9ca765d9c8cf8dc.tar.bz2
mpv-ba1e0116859530aa9f683eccb9ca765d9c8cf8dc.tar.xz
subtitles looked bad here (inverted colors sometimes)
looked like values wrapped around the byte (not sure of the side effects but subtitles look good now) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3039 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'spudec.c')
-rw-r--r--spudec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/spudec.c b/spudec.c
index f455e9ea01..d55ce28fa9 100644
--- a/spudec.c
+++ b/spudec.c
@@ -153,7 +153,11 @@ static void spudec_process_data(spudec_handle_t *this)
len = this->width - x;
/* FIXME have to use palette and alpha map*/
memset(this->image + y * this->width + x, cmap[color], len);
- memset(this->aimage + y * this->width + x, alpha[color], len);
+ if (alpha[color] < cmap[color]) {
+ memset(this->aimage + y * this->width + x, 1, len);
+ } else {
+ memset(this->aimage + y * this->width + x, alpha[color] - cmap[color], len);
+ }
x += len;
if (x >= this->width) {
next_line(this);