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.
This commit is contained in:
wm4 2020-08-27 11:43:06 +02:00
parent 5f89b230c7
commit ab6dbf0a29
3 changed files with 8 additions and 2 deletions

View File

@ -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 {

View File

@ -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;

View File

@ -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)