summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-02-24 22:19:00 +0100
committerwm4 <wm4@nowhere>2016-02-24 22:19:00 +0100
commit174ca8b17298a017759c64ba6012e2ab3689c8e8 (patch)
treec5a154bfa2597141b896cfd0bafe19a4560519f1 /player
parentb654aaea0abe907f60408534af6c7af23307028d (diff)
downloadmpv-174ca8b17298a017759c64ba6012e2ab3689c8e8.tar.bz2
mpv-174ca8b17298a017759c64ba6012e2ab3689c8e8.tar.xz
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.
Diffstat (limited to 'player')
-rw-r--r--player/playloop.c14
1 files changed, 10 insertions, 4 deletions
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);