From 174ca8b17298a017759c64ba6012e2ab3689c8e8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 24 Feb 2016 22:19:00 +0100 Subject: 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. --- player/playloop.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'player') diff --git a/player/playloop.c b/player/playloop.c index 942567b760..aceadd99e7 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -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); -- cgit v1.2.3