diff --git a/player/misc.c b/player/misc.c
index 116ed37fbb..f5cbc2f0ce 100644
--- a/player/misc.c
+++ b/player/misc.c
@@ -15,10 +15,11 @@
* License along with mpv. If not, see .
*/
-#include
-#include
-#include
#include
+#include
+#include
+#include
+#include
#include "mpv_talloc.h"
@@ -191,17 +192,18 @@ void update_vo_playback_state(struct MPContext *mpctx)
{
if (mpctx->video_out && mpctx->video_out->config_ok) {
struct voctrl_playback_state oldstate = mpctx->vo_playback_state;
+ double pos = get_current_pos_ratio(mpctx, false);
struct voctrl_playback_state newstate = {
- .taskbar_progress = mpctx->opts->vo->taskbar_progress,
+ .taskbar_progress = mpctx->opts->vo->taskbar_progress && pos >= 0,
.playing = mpctx->playing,
.paused = mpctx->paused,
- .percent_pos = get_percent_pos(mpctx),
+ .position = pos > 0 ? lrint(pos * UINT8_MAX) : 0,
};
if (oldstate.taskbar_progress != newstate.taskbar_progress ||
oldstate.playing != newstate.playing ||
oldstate.paused != newstate.paused ||
- oldstate.percent_pos != newstate.percent_pos)
+ oldstate.position != newstate.position)
{
// Don't update progress bar if it was and still is hidden
if ((oldstate.playing && oldstate.taskbar_progress) ||
diff --git a/video/out/vo.h b/video/out/vo.h
index 313c08aafc..3afbd6ea21 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -149,7 +149,7 @@ struct voctrl_playback_state {
bool taskbar_progress;
bool playing;
bool paused;
- int percent_pos;
+ uint8_t position;
};
// VOCTRL_PERFORMANCE_DATA
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index a4eaadf170..e6d84b52e1 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -767,8 +767,15 @@ static void update_playback_state(struct vo_w32_state *w32)
return;
}
+ ULONGLONG completed = pstate->position;
+ ULONGLONG total = UINT8_MAX;
+ if (!pstate->position) {
+ completed = 1;
+ total = MAXULONGLONG;
+ }
+
ITaskbarList3_SetProgressValue(w32->taskbar_list3, w32->window,
- pstate->percent_pos, 100);
+ completed, total);
ITaskbarList3_SetProgressState(w32->taskbar_list3, w32->window,
pstate->paused ? TBPF_PAUSED :
TBPF_NORMAL);