summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-12 13:04:21 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-01-25 17:00:08 +0900
commit77d5aa56b3a9e10f324c558dda76f4b28137310b (patch)
treef09d8da9b60967f35cf23fab25af5935a82aca74
parent1f795b6172a5b3d31f20debe46531482e7a033d6 (diff)
downloadmpv-77d5aa56b3a9e10f324c558dda76f4b28137310b.tar.bz2
mpv-77d5aa56b3a9e10f324c558dda76f4b28137310b.tar.xz
player: check sufficient track selection before destroying VO
mpv needs at least an audio or video track to play something. If the track selection is basically insufficient, the player will immediately skip to the next file (or quit). One slightly annoying thing might be that trying to play a subtitle file will close the VO window, and then go to the next file immediately (so "mpv 1.mkv 2.srt 3.mkv" would flash the video window when 2.srt is skipped). Move the check to before the video window is possibly closed. This is a minor cosmetic issue; one can use --force-window to avoid closing the video window at all. Fixes #1459.
-rw-r--r--player/loadfile.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index aa457b3d08..c19f1d651f 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1094,16 +1094,11 @@ goto_reopen_demuxer: ;
}
#endif
- reinit_video_chain(mpctx);
- reinit_audio_chain(mpctx);
- reinit_subs(mpctx, 0);
- reinit_subs(mpctx, 1);
-
- //==================== START PLAYING =======================
-
- if (!mpctx->d_video && !mpctx->d_audio) {
- struct demuxer *d = mpctx->demuxer;
+ if (!mpctx->current_track[0][STREAM_VIDEO] &&
+ !mpctx->current_track[0][STREAM_AUDIO])
+ {
MP_FATAL(mpctx, "No video or audio streams selected.\n");
+ struct demuxer *d = mpctx->demuxer;
if (d->stream->uncached_type == STREAMTYPE_DVB) {
int dir = mpctx->last_dvb_step;
if (demux_stream_control(d, STREAM_CTRL_DVB_STEP_CHANNEL, &dir) > 0)
@@ -1113,6 +1108,11 @@ goto_reopen_demuxer: ;
goto terminate_playback;
}
+ reinit_video_chain(mpctx);
+ reinit_audio_chain(mpctx);
+ reinit_subs(mpctx, 0);
+ reinit_subs(mpctx, 1);
+
MP_VERBOSE(mpctx, "Starting playback...\n");
if (mpctx->max_frames == 0) {