diff options
Diffstat (limited to 'player')
-rw-r--r-- | player/core.h | 1 | ||||
-rw-r--r-- | player/loadfile.c | 3 | ||||
-rw-r--r-- | player/playloop.c | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/player/core.h b/player/core.h index b9fa706f7d..7945080538 100644 --- a/player/core.h +++ b/player/core.h @@ -417,6 +417,7 @@ typedef struct MPContext { bool paused; // internal pause state bool playback_active; // not paused, restarting, loading, unloading + bool in_playloop; // step this many frames, then pause int step_frames; diff --git a/player/loadfile.c b/player/loadfile.c index 1aa4c4a49d..e0a796d9fc 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1274,14 +1274,15 @@ reopen_file: playback_start = mp_time_sec(); mpctx->error_playing = 0; + mpctx->in_playloop = true; while (!mpctx->stop_play) run_playloop(mpctx); + mpctx->in_playloop = false; MP_VERBOSE(mpctx, "EOF code: %d \n", mpctx->stop_play); terminate_playback: - mpctx->playback_active = false; update_core_idle_state(mpctx); process_unload_hooks(mpctx); diff --git a/player/playloop.c b/player/playloop.c index 2c3143ab61..2e18025cc4 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -124,8 +124,8 @@ void update_core_idle_state(struct MPContext *mpctx) { bool eof = mpctx->video_status == STATUS_EOF && mpctx->audio_status == STATUS_EOF; - bool active = - !mpctx->paused && mpctx->restart_complete && mpctx->playing && !eof; + bool active = !mpctx->paused && mpctx->restart_complete && mpctx->playing && + mpctx->in_playloop && !eof; if (mpctx->playback_active != active) { mpctx->playback_active = active; |