From 055b0cc5d8bf69f8fa12a84f24a3efca95c02a60 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 8 Sep 2009 09:06:43 +0000 Subject: Never switch to a program with no audio and no video. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29658 b3059339-0415-0410-9bf9-f77b7e298cf2 --- command.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'command.c') 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; -- cgit v1.2.3