summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'command.c')
-rw-r--r--command.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/command.c b/command.c
index 29d3cf2e94..0700158753 100644
--- a/command.c
+++ b/command.c
@@ -945,6 +945,10 @@ static int mp_property_program(m_option_t * prop, int action, void *arg,
&prog) == DEMUXER_CTRL_NOTIMPL)
return M_PROPERTY_ERROR;
+ if (prog.aid < 0 && prog.vid < 0) {
+ mp_msg(MSGT_CPLAYER, MSGL_ERR, "Selected program contains no audio or video streams!\n");
+ return M_PROPERTY_ERROR;
+ }
mp_property_do("switch_audio", M_PROPERTY_SET, &prog.aid, mpctx);
mp_property_do("switch_video", M_PROPERTY_SET, &prog.vid, mpctx);
return M_PROPERTY_OK;