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

Oskar Liljeblad oskar at osk.mine.nu
Fri Sep 13 11:18:56 CEST 2002


On Friday, September 13, 2002 at 11:51, Arpi wrote:
> Hi,
> 
> > 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
> 
> yes, as it was the goal.
> 
> when you have a widescreen movie, with black bars at top and bottom,
> you want to align the subs right bellow the subtitles.

Do you mean right below the bars? This is exactly what I want too.

But, if you have a widescreen 16:9 TV, and watch a *very* wide
movie (like 2.35:1), you'd ALWAYS have to move the subtitles
up a bit. And the second you do this, they are incorrectly aligned.
Example:

  +-----------------------------------+
  |A                                  |  This is black area, and is only
  +-----------------------------------+  seen on 4:3 TVs.
  |B                                  |  This area is also black, but seen
  +-----------------------------------+  on both 16:9 and 4:3 TVs.
  |                                   |  This is where the movie
  |                                   |  image appears.
  |                                   |
  |                                   |
  |C                                  |
  +-----------------------------------+
  |D                                  |  Black on 16:9 and 4:3 - place for
  +-----------------------------------+  subtitles on 16:9 TVs!
  |E                                  |  Black on 4:3 - place for subtitles
  +-----------------------------------+  on 4:3 TVs (the default placement).

Note that 16:9 TVs doesn't display area A and E at all - it is outside the
viewing area.

And as you know, when you move the subtitles from area E to area D in the
image, they are incorrectly aligned. (If they used to be bottom-aligned
they are now top-aligned.)

Code like this would work. I am - probably incorrectly - assuming that
dys is the screen height here.

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

With this code, if the subtitles are located in the upper half of the screen,
they are top aligned. Otherwise, they are bottom aligned. This works great
here.

Regards,

Oskar Liljeblad (oskar at osk.mine.nu)



More information about the MPlayer-dev-eng mailing list