Index: main/libvo/sub.c =================================================================== RCS file: /cvsroot/mplayer/main/libvo/sub.c,v retrieving revision 1.83 diff -u -r1.83 sub.c --- main/libvo/sub.c 9 Feb 2006 14:07:58 -0000 1.83 +++ main/libvo/sub.c 15 Feb 2006 09:07:40 -0000 @@ -628,12 +628,20 @@ } /// vertical alignment h = dys - obj->y; - if (sub_alignment == 2) - obj->y = dys * sub_pos / 100 - h; - else if (sub_alignment == 1) - obj->y = dys * sub_pos / 100 - h / 2; - else - obj->y = dys * sub_pos / 100; + switch (vo_sub->alignment) { + case SUB_ALIGNMENT_TOPLEFT: + case SUB_ALIGNMENT_TOPRIGHT: + case SUB_ALIGNMENT_TOPCENTER: // top + obj->y = dys - (dys * (sub_pos / 100)); + break; + case SUB_ALIGNMENT_MIDDLELEFT: + case SUB_ALIGNMENT_MIDDLERIGHT: + case SUB_ALIGNMENT_MIDDLECENTER: // center + obj->y = (dys / 2) - h / 2; + break; + default: // bottom + obj->y = dys * (sub_pos / 100); + } if (obj->y < 0) obj->y = 0; @@ -681,11 +689,14 @@ switch (obj->alignment&0x3) { case 1: // left - x = counter; + x = obj->bbox.x1 = 0; + obj->bbox.x2 = xmax-xmin; break; case 2: // right - x = 2 * obj->params.subtitle.xtbl[i] - counter - ((obj->params.subtitle.xtbl[i] == counter) ? 0 : 1); + obj->bbox.x2 = dxs; + obj->bbox.x1 = dxs - xmax + xmin; + x = 2 * obj->params.subtitle.xtbl[i] - counter - ((obj->params.subtitle.xtbl[i] == counter) ? 0 : 1) + dxs - xmax; break; default: //center