diff options
author | wm4 <wm4@nowhere> | 2020-08-27 11:43:06 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-08-27 11:55:20 +0200 |
commit | ab6dbf0a294d695449b46c6ac1e5603fd9a8a8e7 (patch) | |
tree | cb40cb4b55c6eb36c27db890d68f97d590b51983 /player | |
parent | 5f89b230c77af7823f48443bdd28899f616ded45 (diff) | |
download | mpv-ab6dbf0a294d695449b46c6ac1e5603fd9a8a8e7.tar.bz2 mpv-ab6dbf0a294d695449b46c6ac1e5603fd9a8a8e7.tar.xz |
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.
Diffstat (limited to 'player')
-rw-r--r-- | player/core.h | 1 | ||||
-rw-r--r-- | player/playloop.c | 7 | ||||
-rw-r--r-- | 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) |