diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-05 00:03:35 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-05 00:03:35 +0000 |
commit | 268b2c1a0f689af9ea58336368286c1f5e1f3f72 (patch) | |
tree | dd21a032873d9b76cc79014c09f2057b38dd1186 /libvo/sub.c | |
parent | 7228f67795c10a8e9a0bf633efa3bba7da79551f (diff) | |
download | mpv-268b2c1a0f689af9ea58336368286c1f5e1f3f72.tar.bz2 mpv-268b2c1a0f689af9ea58336368286c1f5e1f3f72.tar.xz |
overlapping subtitles support is now optional, can be disabled (-nooverlapsub)
patch by Salvatore Falco <sfalco@studenti.ing.uniroma1.it>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8362 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/sub.c')
-rw-r--r-- | libvo/sub.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/libvo/sub.c b/libvo/sub.c index 67003cf9a1..075431df5e 100644 --- a/libvo/sub.c +++ b/libvo/sub.c @@ -351,7 +351,20 @@ inline static void vo_update_text_sub(mp_osd_obj_t* obj,int dxs,int dys){ lastk=k; lastStripPosition=j; lastxsize=xsize; - } else if ((font=vo_font->font[c])>=0){ + } else if ((!suboverlap_enabled) && ((font = vo_font->font[c]) >= 0)) { + /* + With overlapping subtitles, we need to comment this out, + beacuse that part of the code creates subtitles with the + last line blank (" "): in this case previous 'if' statement + is false an following 'if' is not executed. When, instead, + a subtitle with a non-blank last line arrives, the following + code is executed, and the result is a small 'jump' of the + subtiles. We can not simply delete the following, unless + having the last subtitle line partly drawn outside the + screen, so, some lines forward, we introduce an increment + which affects both blank and non-blank lines. + *sfalco* + */ if (vo_font->pic_a[font]->h > h){ h=vo_font->pic_a[font]->h; } @@ -396,6 +409,13 @@ inline static void vo_update_text_sub(mp_osd_obj_t* obj,int dxs,int dys){ } } + /* + Here is the little increment we talked about before. '40' is the + ASCII code for '(', which, hopefully, is the highest char of the + font. + *sfalco* + */ + if(suboverlap_enabled) obj->y -= vo_font->pic_a[vo_font->font[40]]->h - vo_font->height; if (obj->y >= (dys * sub_pos / 100)){ int old=obj->y; obj->y = dys * sub_pos /100; |