From 9194c810705c53d4052ebb8e2a276b52571843b0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 25 Aug 2012 11:48:22 +0200 Subject: 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.) --- mplayer.c | 8 ++++++-- 1 file 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) { -- cgit v1.2.3