# HG changeset patch # User uau # Date 1233364189 0 # Node ID c616bf5d520b69c059c2c1d488a97c9fefded828 # Parent e8bae856d691c82a1e8b7474f0eaf3471a6ed695 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 diff -r e8bae856d691 -r c616bf5d520b command.c --- a/command.c Fri Jan 30 23:58:07 2009 +0000 +++ b/command.c Sat Jan 31 01:09:49 2009 +0000 @@ -2463,6 +2463,8 @@ 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 @@ 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;