[Mplayer-cvslog] CVS: main/input input.c,1.13,1.14

Alban Bedel CVS albeu at mplayer.dev.hu
Sun Feb 24 22:22:14 CET 2002


Update of /cvsroot/mplayer/main/input
In directory mplayer:/var/tmp.root/cvs-serv29794/input

Modified Files:
	input.c 
Log Message:
Small bugfix (memcpy too small without sizeof(int) :( )
Add move invalide bind msg so it appear only when needed :)


Index: input.c
===================================================================
RCS file: /cvsroot/mplayer/main/input/input.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- input.c	24 Feb 2002 16:31:27 -0000	1.13
+++ input.c	24 Feb 2002 21:22:12 -0000	1.14
@@ -527,6 +527,7 @@
 static mp_cmd_t*
 mp_input_get_cmd_from_keys(int n,int* keys, int paused) {
   char* cmd = NULL;
+  mp_cmd_t* ret;
   // In pause mode we return pause for the first key wich come
   if(paused)
     return mp_input_parse_cmd("pause");
@@ -546,7 +547,17 @@
     printf("                         \n");
     return NULL;
   }
-  return  mp_input_parse_cmd(cmd);
+  ret =  mp_input_parse_cmd(cmd);
+  if(!ret) {
+    printf("Invalid command for binded key %s",mp_input_get_key_name(key_down[0]));
+    if(  num_key_down > 1) {
+      unsigned int s;
+      for(s=1; s < num_key_down; s++)
+	printf("-%s",mp_input_get_key_name(key_down[s]));
+    }
+    printf(" : %s             \n",cmd);
+  }
+  return ret;
 }
 
 static mp_cmd_t*
@@ -660,15 +671,6 @@
     } 
     // We ignore key from last combination
     ret = last_key_down ? mp_input_get_cmd_from_keys(num_key_down,key_down,paused) : NULL;
-    if(last_key_down && !ret) {     
-      printf("Invalid command for binded key %s",mp_input_get_key_name(key_down[0]));
-      if(  num_key_down > 1) {
-	unsigned int s;
-	for(s=1; s < num_key_down; s++)
-	  printf("-%s",mp_input_get_key_name(key_down[s]));
-      }
-      printf("             \n");
-    }
     // Remove the key
     if(j+1 < num_key_down)
       memmove(&key_down[j],&key_down[j+1],(num_key_down-(j+1))*sizeof(int));
@@ -954,7 +956,7 @@
   if(bind->cmd)
     free(bind->cmd);
   bind->cmd = strdup(cmd);
-  memcpy(bind->input,keys,MP_MAX_KEY_DOWN+1);
+  memcpy(bind->input,keys,(MP_MAX_KEY_DOWN+1)*sizeof(int));
 }
 
 




More information about the MPlayer-cvslog mailing list