summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authoruau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-01-31 01:09:49 +0000
committeruau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-01-31 01:09:49 +0000
commit0e77da241da8b911c96a0e22898e84d7f7b74678 (patch)
tree33b893126bff0471d9fba1e438404008eab6a5d0 /command.c
parentdc4b6fcddc8dcbac2adc52ea0e9c8e74caac029f (diff)
downloadmpv-0e77da241da8b911c96a0e22898e84d7f7b74678.tar.bz2
mpv-0e77da241da8b911c96a0e22898e84d7f7b74678.tar.xz
command.c: Fix some commands crashing during audio-only playback
The SWITCH_RATIO and VF_CHANGE_RECTANGLE cases crashed if the user gave those commands when there was no video stream. Make them no-op instead. Patch by ShadowJK git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28403 b3059339-0415-0410-9bf9-f77b7e298cf2
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 3163ec6721..0a67038a70 100644
--- a/command.c
+++ b/command.c
@@ -2463,6 +2463,8 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_SWITCH_RATIO:
+ if (!sh_video)
+ break;
if (cmd->nargs == 0 || cmd->args[0].v.f == -1)
movie_aspect = (float) sh_video->disp_w / sh_video->disp_h;
else
@@ -2969,6 +2971,8 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
break;
case MP_CMD_VF_CHANGE_RECTANGLE:
+ if (!sh_video)
+ break;
set_rectangle(sh_video, cmd->args[0].v.i, cmd->args[1].v.i);
break;