changeset 1727:9da2b587b029

changes according to OSD calculations
author atlka
date Tue, 28 Aug 2001 14:22:37 +0000
parents 38871427a131
children 014b29286ec4
files libvo/sub.c mplayer.c
diffstat 2 files changed, 10 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/sub.c	Tue Aug 28 12:43:41 2001 +0000
+++ b/libvo/sub.c	Tue Aug 28 14:22:37 2001 +0000
@@ -34,8 +34,8 @@
 
 // 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,12 +56,9 @@
 
 	if (vo_osd_progbar_value<=0)
      	   mark=0;
-	else {
-	   int mm=vo_osd_progbar_value*elems;
-	   mark=mm>>8;
-	   if (mm & 0x00FF) mark++;
-	   if (mark>elems) mark=elems;
-	}
+	else if ((mark=(vo_osd_progbar_value*elems)>>8)>elems)
+	   mark=elems;
+
 //        printf("osd.progbar  width=%d  xpos=%d\n",width,x);
 
         c=vo_osd_progbar_type;
--- a/mplayer.c	Tue Aug 28 12:43:41 2001 +0000
+++ b/mplayer.c	Tue Aug 28 14:22:37 2001 +0000
@@ -1759,11 +1759,11 @@
         // Set OSD:
       if(osd_level){
         int len=((demuxer->movi_end-demuxer->movi_start)>>8);
-        if(len>0){
-          osd_visible=sh_video->fps; // 1 sec
-          vo_osd_progbar_type=0;
-	  vo_osd_progbar_value=(demuxer->filepos-demuxer->movi_start)/len;
-        }
+        if (len>0){
+	   osd_visible=sh_video->fps; // 1 sec
+	   vo_osd_progbar_type=0;
+	   vo_osd_progbar_value=(demuxer->filepos-demuxer->movi_start)/len;
+	}
       }
 #endif