diff --git a/libvo/sub.c b/libvo/sub.c index 890b9a3820..f987e2b8ae 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,12 +56,9 @@ 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 { - 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; diff --git a/mplayer.c b/mplayer.c index 8f175e97ac..d53bbc6c5e 100644 --- a/mplayer.c +++ b/mplayer.c @@ -1759,11 +1759,11 @@ if(rel_seek_secs || abs_seek_pos){ // 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