summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-28 19:51:44 +0100
committerwm4 <wm4@nowhere>2014-10-28 20:30:12 +0100
commit2c320fb609dde644bcfa3389e6a2664baa38ee2b (patch)
tree34dd218faa868661b0edd5e86d9bad55583f33bb /player
parent0c71ae0528a6143995697fb02023c3180ee44c18 (diff)
downloadmpv-2c320fb609dde644bcfa3389e6a2664baa38ee2b.tar.bz2
mpv-2c320fb609dde644bcfa3389e6a2664baa38ee2b.tar.xz
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).
Diffstat (limited to 'player')
-rw-r--r--player/client.c1
-rw-r--r--player/loadfile.c2
-rw-r--r--player/misc.c5
3 files changed, 5 insertions, 3 deletions
diff --git a/player/client.c b/player/client.c
index 2308555a1e..8e2bc4d1b7 100644
--- a/player/client.c
+++ b/player/client.c
@@ -417,6 +417,7 @@ mpv_handle *mpv_create(void)
mpv_set_option_string(ctx, "input-appleremote", "no");
mpv_set_option_string(ctx, "input-media-keys", "no");
mpv_set_option_string(ctx, "input-app-events", "no");
+ mpv_set_option_string(ctx, "stop-playback-on-init-failure", "yes");
} else {
mp_destroy(mpctx);
}
diff --git a/player/loadfile.c b/player/loadfile.c
index 440b29d6a9..b68926f507 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1091,7 +1091,7 @@ goto_reopen_demuxer: ;
struct demuxer *d = mpctx->demuxer;
MP_FATAL(mpctx, "No video or audio streams selected.\n");
if (d->stream->uncached_type == STREAMTYPE_DVB) {
- int dir = mpctx->last_dvb_step;
+ int dir = mpctx->last_dvb_step;
if (demux_stream_control(d, STREAM_CTRL_DVB_STEP_CHANNEL, &dir) > 0)
mpctx->stop_play = PT_RELOAD_DEMUXER;
}
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)