mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 09:32:40 +00:00
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
This commit is contained in:
parent
b05f2d0bdf
commit
055b0cc5d8
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user