summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authoratlka <atlka@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-09-10 13:23:27 +0000
committeratlka <atlka@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-09-10 13:23:27 +0000
commit87baa9c19641486af378b44f7a6f83d561e0445f (patch)
tree43e68125555b0746f1d9164ce275b1bacdcdf939 /libvo
parente00e5a58f4678ce8ac8c022b2b5313b0acec086b (diff)
downloadmpv-87baa9c19641486af378b44f7a6f83d561e0445f.tar.bz2
mpv-87baa9c19641486af378b44f7a6f83d561e0445f.tar.xz
corrections to OSD mark position
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1879 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/sub.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/libvo/sub.c b/libvo/sub.c
index ff3a784605..52b9edf9f6 100644
--- a/libvo/sub.c
+++ b/libvo/sub.c
@@ -34,8 +34,8 @@ int vo_osd_progbar_value=100; // 0..256
// if we have n=256 bars then OSD progbar looks like below
//
-// 0 1 2 3 ... 256 <= vo_osd_progbar_value
-// | | | | |
+// 0 1 2 3 ... 256 <= vo_osd_progbar_value
+// | | | | |
// [ === === === ... === ]
//
// the above schema is rescalled to n=elems bars
@@ -56,8 +56,13 @@ inline static void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x
if (vo_osd_progbar_value<=0)
mark=0;
- else if ((mark=(vo_osd_progbar_value*elems)>>8)>elems)
- mark=elems;
+ else {
+ int ev=vo_osd_progbar_value*elems;
+ mark=ev>>8;
+ if (ev & 0xFF) mark++;
+ if (mark>elems) mark=elems;
+ }
+
// printf("osd.progbar width=%d xpos=%d\n",width,x);