[MPlayer-cvslog] r28403 - trunk/command.c

uau subversion at mplayerhq.hu
Sat Jan 31 02:09:50 CET 2009


Author: uau
Date: Sat Jan 31 02:09:49 2009
New Revision: 28403

Log:
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

Modified:
   trunk/command.c

Modified: trunk/command.c
==============================================================================
--- trunk/command.c	Sat Jan 31 00:58:07 2009	(r28402)
+++ trunk/command.c	Sat Jan 31 02:09:49 2009	(r28403)
@@ -2463,6 +2463,8 @@ int run_command(MPContext * mpctx, mp_cm
 	    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_cm
 	    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;
 



More information about the MPlayer-cvslog mailing list