summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-12-05 00:03:35 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-12-05 00:03:35 +0000
commit268b2c1a0f689af9ea58336368286c1f5e1f3f72 (patch)
treedd21a032873d9b76cc79014c09f2057b38dd1186 /libvo
parent7228f67795c10a8e9a0bf633efa3bba7da79551f (diff)
downloadmpv-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')
-rw-r--r--libvo/sub.c22
-rw-r--r--libvo/sub.h1
2 files changed, 22 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;
diff --git a/libvo/sub.h b/libvo/sub.h
index 5646535f42..ead5a131ff 100644
--- a/libvo/sub.h
+++ b/libvo/sub.h
@@ -98,6 +98,7 @@ extern char *sub_cp;
#endif
extern int sub_pos;
extern int sub_visibility;
+extern int suboverlap_enabled;
//extern void vo_draw_text_osd(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
//extern void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));