aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/command.c b/src/command.c
index 6cc49eee6..9d0fca603 100644
--- a/src/command.c
+++ b/src/command.c
@@ -144,6 +144,16 @@ int handleStop(FILE * fp, unsigned int * permission, int argArrayLength,
int handlePause(FILE * fp, unsigned int * permission,
int argArrayLength, char ** argArray)
{
+ if(argArrayLength==2) {
+ char * test;
+ int pause = strtol(argArray[1],&test,10);
+ if(*test!='\0' || (pause!=0 && pause!=1)) {
+ myfprintf(fp,"%s \%s\" is not 0 or 1\n",
+ COMMAND_RESPOND_ERROR,pause);
+ return -1;
+ }
+ return playerSetPause(fp,pause);
+ }
return playerPause(fp);
}
@@ -524,7 +534,7 @@ void initCommands() {
addCommand(COMMAND_PLAY ,PERMISSION_CONTROL, 0, 1,handlePlay);
addCommand(COMMAND_STOP ,PERMISSION_CONTROL, 0, 0,handleStop);
- addCommand(COMMAND_PAUSE ,PERMISSION_CONTROL, 0, 0,handlePause);
+ addCommand(COMMAND_PAUSE ,PERMISSION_CONTROL, 0, 1,handlePause);
addCommand(COMMAND_STATUS ,PERMISSION_READ, 0, 0,commandStatus);
addCommand(COMMAND_KILL ,PERMISSION_ADMIN, -1,-1,handleKill);
addCommand(COMMAND_CLOSE ,0, -1,-1,handleClose);