mirror of
https://github.com/mpv-player/mpv
synced 2025-03-10 16:24:20 +00:00
osd: use --osd-duration for OSD bar
It was hardcoded to 1 second (which is also the default for --osd-duration, so this was probably never noticed).
This commit is contained in:
parent
e5f3b8da26
commit
187903ef31
@ -1363,7 +1363,7 @@ void set_osd_bar(struct MPContext *mpctx, int type, const char *name,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (mpctx->sh_video && opts->term_osd != 1) {
|
if (mpctx->sh_video && opts->term_osd != 1) {
|
||||||
mpctx->osd_visible = (GetTimerMS() + 1000) | 1;
|
mpctx->osd_visible = (GetTimerMS() + opts->osd_duration) | 1;
|
||||||
mpctx->osd->progbar_type = type;
|
mpctx->osd->progbar_type = type;
|
||||||
mpctx->osd->progbar_value = 256 * (val - min) / (max - min);
|
mpctx->osd->progbar_value = 256 * (val - min) / (max - min);
|
||||||
vo_osd_changed(OSDTYPE_PROGBAR);
|
vo_osd_changed(OSDTYPE_PROGBAR);
|
||||||
@ -1387,8 +1387,10 @@ static void update_osd_bar(struct MPContext *mpctx, int type,
|
|||||||
|
|
||||||
void set_osd_function(struct MPContext *mpctx, int osd_function)
|
void set_osd_function(struct MPContext *mpctx, int osd_function)
|
||||||
{
|
{
|
||||||
|
struct MPOpts *opts = &mpctx->opts;
|
||||||
|
|
||||||
mpctx->osd_function = osd_function;
|
mpctx->osd_function = osd_function;
|
||||||
mpctx->osd_visible = (GetTimerMS() + 1000) | 1;
|
mpctx->osd_visible = (GetTimerMS() + opts->osd_duration) | 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user