summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-25 11:48:22 +0200
committerwm4 <wm4@nowhere>2012-09-18 21:04:45 +0200
commit9194c810705c53d4052ebb8e2a276b52571843b0 (patch)
tree63dea31c07bba151561a7f8af54d17598b2d8b79
parentcde59e913f2c1c2cca27d10daddb54b4de6cc90a (diff)
downloadmpv-9194c810705c53d4052ebb8e2a276b52571843b0.tar.bz2
mpv-9194c810705c53d4052ebb8e2a276b52571843b0.tar.xz
mplayer: do not cancel playback if VF/VO config fails
Usually failing to initialize the video chain does not stop playback, and continues with audio-only. But when VF/VO config failed (the second step in initializing them), playback was canceled and advanced to the next file. Make it more consistent and just switch off video if it fails. Also, if no audio track is selected, go to next file anyway. The player core goes into some sort of idle mode if no video and audio track is selected, and we don't want to trigger it here. (It's unclear whether that is a bug or feature: it's meant to work around some corner cases, but maybe it shouldn't be triggered when switching off video & audio tracks in normal playback.)
-rw-r--r--mplayer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mplayer.c b/mplayer.c
index 06a57b597f..fd409cc27c 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -3078,8 +3078,12 @@ static void run_playloop(struct MPContext *mpctx)
mp_tmsg(MSGT_CPLAYER, MSGL_FATAL,
"\nFATAL: Could not initialize video filters (-vf) "
"or video output (-vo).\n");
- mpctx->stop_play = PT_NEXT_ENTRY;
- return;
+ uninit_player(mpctx, INITIALIZED_VCODEC | INITIALIZED_VO);
+ cleanup_demux_stream(mpctx, STREAM_VIDEO);
+ mpctx->current_track[STREAM_VIDEO] = NULL;
+ if (!mpctx->current_track[STREAM_AUDIO])
+ mpctx->stop_play = PT_NEXT_ENTRY;
+ break;
}
video_left = frame_time >= 0;
if (video_left && !mpctx->restart_playback) {