[MPlayer-dev-eng] text subtitle position (sub_pos)

Oskar Liljeblad oskar at osk.mine.nu
Fri Sep 13 10:17:40 CEST 2002


Hi

You can set text subtitle position with R,T (sub_pos variable).
This is set to 100 (meaning 100%) by default, and it looks like
this then:

 +---------------+          +---------------+
 |               |          |               |
 |               |          |               |
 |     two       |          |               |
 |  line subs    | <-base-> | one line subs |
 +---------------+          +---------------+
 
However, when you move the subs up by decreasing sub_pos, it
will look something like this:

 +---------------+          +---------------+
 |               |          |               |
 |     two       |       -> | one line subs |
 |  line subs    | <-base?  |               |
 |               |          |               |
 +---------------+          +---------------+
 
As you can see, the subtitles are now 'top aligned' instead of
bottom aligned. I want them to look like this:

 +---------------+          +---------------+
 |               |          |               |
 |     two       |          |               |
 |  line subs    | <-base-> | one line subs |
 |               |          |               |
 +---------------+          +---------------+

The reason for this is the code in libvo/sub.c (around line 394):

    if (obj->y >= (dys * sub_pos / 100)){
	  int old=obj->y;
	  obj->y = dys * sub_pos /100;
	  obj->bbox.y2-=old-obj->y;
    }

(This is the ONLY place in libvo/sub.c where sub_pos is used.)
What I suggest here is to always modify obj->y if sub_pos != 100,
like this:

    obj->y = (dys * sub_pos / 100) - obj->params.subtitle.lines*vo_font->height;

But this isn't correct (for various reasons). Maybe someone could
help me out here?

Regards,

Oskar Liljeblad (oskar at osk.mine.nu)



More information about the MPlayer-dev-eng mailing list