mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 21:27:08 +00:00
player: honor --force-window if video is selected, but inactive
If a video track is selected, but no video is decoded from it (mostly with broken files), then create the window anyway.
This commit is contained in:
parent
b654aaea0a
commit
174ca8b172
@ -766,14 +766,20 @@ static void handle_chapter_change(struct MPContext *mpctx)
|
||||
// no way to know if this has already been done or not).
|
||||
int handle_force_window(struct MPContext *mpctx, bool force)
|
||||
{
|
||||
// Don't interfere with real video playback
|
||||
if (mpctx->vo_chain)
|
||||
return 0;
|
||||
|
||||
// True if we're either in idle mode, or loading of the file has finished.
|
||||
// It's also set via force in some stages during file loading.
|
||||
bool act = !mpctx->playing || mpctx->playback_initialized || force;
|
||||
|
||||
// On the other hand, if a video track is selected, but no video is ever
|
||||
// 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);
|
||||
|
||||
// Don't interfere with real video playback
|
||||
if (mpctx->vo_chain && !stalled_video)
|
||||
return 0;
|
||||
|
||||
if (!mpctx->opts->force_vo) {
|
||||
if (act)
|
||||
uninit_video_out(mpctx);
|
||||
|
Loading…
Reference in New Issue
Block a user