player: fix --force-window behavior

_Of course_ the previous commit broke --force-window behavior (like it
does every single time I touch it).

vo_has_frame() gets cleared after a seek, so e.g. stopping playback of a
file and going to the next by keeping the seek key down will enter a
short moment without video at the end of the first file, which will set
the stalled_video variable to true. Prevent it by using the indication
whether the window was properly created (which is probably exactly what
we want here).

This function is also responsible for destroying the window when needed,
and obviously we should never do that while video is active. (This is
the actual bug, although the other change in this commit already hides
the common breakage it caused.)
This commit is contained in:
wm4 2016-02-25 11:21:54 +01:00
parent 174ca8b172
commit b4bbfea71d
1 changed files with 2 additions and 2 deletions

View File

@ -774,14 +774,14 @@ int handle_force_window(struct MPContext *mpctx, bool force)
// decoded on it, then create the window.
bool stalled_video = mpctx->playback_initialized && mpctx->restart_complete &&
mpctx->video_status == STATUS_EOF && mpctx->vo_chain &&
!vo_has_frame(mpctx->video_out);
!mpctx->video_out->config_ok;
// Don't interfere with real video playback
if (mpctx->vo_chain && !stalled_video)
return 0;
if (!mpctx->opts->force_vo) {
if (act)
if (act && !mpctx->vo_chain)
uninit_video_out(mpctx);
return 0;
}