From 2c320fb609dde644bcfa3389e6a2664baa38ee2b Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 28 Oct 2014 19:51:44 +0100 Subject: player: add an option to abort playback on partial init failures This is probably what libmpv users want; and it also improves error reporting (or we'd have to add a way to communicate such mid-playback failures as events). --- player/misc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'player/misc.c') diff --git a/player/misc.c b/player/misc.c index c178ec7b39..6ddbc31f52 100644 --- a/player/misc.c +++ b/player/misc.c @@ -189,8 +189,9 @@ void error_on_track(struct MPContext *mpctx, struct track *track) MP_INFO(mpctx, "Audio: no audio\n"); if (track->type == STREAM_VIDEO) MP_INFO(mpctx, "Video: no video\n"); - if (!mpctx->current_track[0][STREAM_AUDIO] && - !mpctx->current_track[0][STREAM_VIDEO]) + if (mpctx->opts->stop_playback_on_init_failure || + (!mpctx->current_track[0][STREAM_AUDIO] && + !mpctx->current_track[0][STREAM_VIDEO])) { mpctx->stop_play = PT_ERROR; if (mpctx->error_playing >= 0) -- cgit v1.2.3