summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-09-16 22:28:12 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-09-16 22:28:12 +0300
commite1ecc4315265c465080616b8d8d9257b3aab6ee9 (patch)
treed8a3aacf1b5468c59da202e44c5035924f5c1a3e /command.c
parent0e1b7765be878491565cf5e471f22b15e106164c (diff)
parent4dae2a980c4313deed6ddb69556d2ead4417119c (diff)
downloadmpv-e1ecc4315265c465080616b8d8d9257b3aab6ee9.tar.bz2
mpv-e1ecc4315265c465080616b8d8d9257b3aab6ee9.tar.xz
Merge svn changes up to r29684
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 67b3ac16f4..0d799c356a 100644
--- a/command.c
+++ b/command.c
@@ -974,6 +974,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;