From ab6dbf0a294d695449b46c6ac1e5603fd9a8a8e7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 27 Aug 2020 11:43:06 +0200 Subject: player: fix video paused condition on VO creation Doesn't take paused_for_cache into account. For consistency; unlikely to matter at all in practice. --- player/core.h | 1 + player/playloop.c | 7 ++++++- player/video.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/player/core.h b/player/core.h index 810c192885..738233c072 100644 --- a/player/core.h +++ b/player/core.h @@ -615,6 +615,7 @@ int handle_force_window(struct MPContext *mpctx, bool force); void seek_to_last_frame(struct MPContext *mpctx); void update_screensaver_state(struct MPContext *mpctx); void update_ab_loop_clip(struct MPContext *mpctx); +bool get_internal_paused(struct MPContext *mpctx); // scripting.c struct mp_script_args { diff --git a/player/playloop.c b/player/playloop.c index 5b57cfa0bf..02a9c64a03 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -145,6 +145,11 @@ void update_core_idle_state(struct MPContext *mpctx) } } +bool get_internal_paused(struct MPContext *mpctx) +{ + return mpctx->opts->pause || mpctx->paused_for_cache; +} + // The value passed here is the new value for mpctx->opts->pause void set_pause_state(struct MPContext *mpctx, bool user_pause) { @@ -152,7 +157,7 @@ void set_pause_state(struct MPContext *mpctx, bool user_pause) opts->pause = user_pause; - bool internal_paused = opts->pause || mpctx->paused_for_cache; + bool internal_paused = get_internal_paused(mpctx); if (internal_paused != mpctx->paused) { mpctx->paused = internal_paused; diff --git a/player/video.c b/player/video.c index 7b4cd86444..2ae581fcfc 100644 --- a/player/video.c +++ b/player/video.c @@ -275,7 +275,7 @@ void reinit_video_chain_src(struct MPContext *mpctx, struct track *track) update_screensaver_state(mpctx); - vo_set_paused(vo_c->vo, mpctx->paused); + vo_set_paused(vo_c->vo, get_internal_paused(mpctx)); // If we switch on video again, ensure audio position matches up. if (mpctx->ao_chain) -- cgit v1.2.3