summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-25 21:47:43 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-25 22:48:18 +0300
commit4cb23ad350f566460d96bf24fcc1949d57a0701f (patch)
treefa75aa9e5e2fb2327ba8ec4b7c04c43447f533d0
parent1393793cd3a90b2ef7ca049dfc693692d3749d94 (diff)
downloadmpv-4cb23ad350f566460d96bf24fcc1949d57a0701f.tar.bz2
mpv-4cb23ad350f566460d96bf24fcc1949d57a0701f.tar.xz
input: remove unused "paused" arguments from some functions
-rw-r--r--input/input.c28
-rw-r--r--input/input.h4
-rw-r--r--libmenu/vf_menu.c6
-rw-r--r--mplayer.c10
4 files changed, 24 insertions, 24 deletions
diff --git a/input/input.c b/input/input.c
index c6a2551157..0c50bdff08 100644
--- a/input/input.c
+++ b/input/input.c
@@ -1026,8 +1026,7 @@ static mp_cmd_bind_section_t *get_bind_section(struct input_ctx *ictx,
return bind_section;
}
-static mp_cmd_t *get_cmd_from_keys(struct input_ctx *ictx, int n, int *keys,
- int paused)
+static mp_cmd_t *get_cmd_from_keys(struct input_ctx *ictx, int n, int *keys)
{
char* cmd = NULL;
mp_cmd_t* ret;
@@ -1068,7 +1067,7 @@ static mp_cmd_t *get_cmd_from_keys(struct input_ctx *ictx, int n, int *keys,
}
-static mp_cmd_t* interpret_key(struct input_ctx *ictx, int code, int paused)
+static mp_cmd_t* interpret_key(struct input_ctx *ictx, int code)
{
unsigned int j;
mp_cmd_t* ret;
@@ -1118,7 +1117,7 @@ static mp_cmd_t* interpret_key(struct input_ctx *ictx, int code, int paused)
}
// We ignore key from last combination
ret = ictx->last_key_down ?
- get_cmd_from_keys(ictx, ictx->num_key_down, ictx->key_down, paused)
+ get_cmd_from_keys(ictx, ictx->num_key_down, ictx->key_down)
: NULL;
// Remove the key
if (j+1 < ictx->num_key_down)
@@ -1134,7 +1133,7 @@ static mp_cmd_t* interpret_key(struct input_ctx *ictx, int code, int paused)
return ret;
}
-static mp_cmd_t *check_autorepeat(struct input_ctx *ictx, int paused)
+static mp_cmd_t *check_autorepeat(struct input_ctx *ictx)
{
// No input : autorepeat ?
if (ictx->ar_rate > 0 && ictx->ar_state >=0 && ictx->num_key_down > 0
@@ -1144,7 +1143,7 @@ static mp_cmd_t *check_autorepeat(struct input_ctx *ictx, int paused)
if (ictx->ar_state == 0
&& (t - ictx->last_key_down) >= ictx->ar_delay*1000) {
ictx->ar_cmd = get_cmd_from_keys(ictx, ictx->num_key_down,
- ictx->key_down, paused);
+ ictx->key_down);
if (!ictx->ar_cmd) {
ictx->ar_state = -1;
return NULL;
@@ -1163,7 +1162,7 @@ static mp_cmd_t *check_autorepeat(struct input_ctx *ictx, int paused)
}
-static mp_cmd_t *read_events(struct input_ctx *ictx, int time, int paused)
+static mp_cmd_t *read_events(struct input_ctx *ictx, int time)
{
int i;
int got_cmd = 0;
@@ -1233,7 +1232,7 @@ static mp_cmd_t *read_events(struct input_ctx *ictx, int time, int paused)
int code = key_fds[i].read_func.key(key_fds[i].ctx, key_fds[i].fd);
if (code >= 0) {
- mp_cmd_t *ret = interpret_key(ictx, code, paused);
+ mp_cmd_t *ret = interpret_key(ictx, code);
if (ret)
return ret;
}
@@ -1246,7 +1245,7 @@ static mp_cmd_t *read_events(struct input_ctx *ictx, int time, int paused)
key_fds[i].dead = 1;
}
}
- mp_cmd_t *autorepeat_cmd = check_autorepeat(ictx, paused);
+ mp_cmd_t *autorepeat_cmd = check_autorepeat(ictx);
if (autorepeat_cmd)
return autorepeat_cmd;
@@ -1306,8 +1305,7 @@ static mp_cmd_t *get_queued_cmd(struct input_ctx *ictx, int peek_only)
* \param peek_only when set, the returned command stays in the queue.
* Do not free the returned cmd whe you set this!
*/
-mp_cmd_t *mp_input_get_cmd(struct input_ctx *ictx, int time, int paused,
- int peek_only)
+mp_cmd_t *mp_input_get_cmd(struct input_ctx *ictx, int time, int peek_only)
{
mp_cmd_t* ret = NULL;
mp_cmd_filter_t* cf;
@@ -1320,7 +1318,7 @@ mp_cmd_t *mp_input_get_cmd(struct input_ctx *ictx, int time, int paused,
ret = get_queued_cmd(ictx, peek_only);
if(ret) break;
from_queue = 0;
- ret = read_events(ictx, time, paused);
+ ret = read_events(ictx, time);
if (!ret) {
from_queue = 1;
ret = get_queued_cmd(ictx, peek_only);
@@ -1330,7 +1328,7 @@ mp_cmd_t *mp_input_get_cmd(struct input_ctx *ictx, int time, int paused,
if(!ret) return NULL;
for(cf = cmd_filters ; cf ; cf = cf->next) {
- if(cf->filter(ret,paused,cf->ctx)) {
+ if (cf->filter(ret, cf->ctx)) {
if (peek_only && from_queue)
// The filter ate the cmd, so we remove it from queue
ret = get_queued_cmd(ictx, 0);
@@ -1835,7 +1833,7 @@ static int print_cmd_list(m_option_t* cfg)
int mp_input_check_interrupt(struct input_ctx *ictx, int time)
{
mp_cmd_t* cmd;
- if ((cmd = mp_input_get_cmd(ictx, time, 0, 1)) == NULL)
+ if ((cmd = mp_input_get_cmd(ictx, time, 1)) == NULL)
return 0;
switch(cmd->id) {
case MP_CMD_QUIT:
@@ -1846,7 +1844,7 @@ int mp_input_check_interrupt(struct input_ctx *ictx, int time)
return 1;
}
// remove the cmd from the queue
- cmd = mp_input_get_cmd(ictx, time, 0, 0);
+ cmd = mp_input_get_cmd(ictx, time, 0);
mp_cmd_free(cmd);
return 0;
}
diff --git a/input/input.h b/input/input.h
index 82718b9b29..b992b13d1c 100644
--- a/input/input.h
+++ b/input/input.h
@@ -219,7 +219,7 @@ typedef void (*mp_close_func_t)(int fd);
// Set this to grab all incoming key codes
extern int (*mp_input_key_cb)(int code);
// Should return 1 if the command was processed
-typedef int (*mp_input_cmd_filter)(mp_cmd_t* cmd, int paused, void* ctx);
+typedef int (*mp_input_cmd_filter)(mp_cmd_t *cmd, void *ctx);
// This function adds a new key driver.
// The first arg is a file descriptor (use a negative value if you don't use any fd)
@@ -254,7 +254,7 @@ int mp_input_queue_cmd(struct input_ctx *ictx, mp_cmd_t* cmd);
// This function retrieves the next available command waiting no more than time msec.
// If pause is true, the next input will always return a pause command.
mp_cmd_t*
-mp_input_get_cmd(struct input_ctx *ictx, int time, int paused, int peek_only);
+mp_input_get_cmd(struct input_ctx *ictx, int time, int peek_only);
mp_cmd_t*
mp_input_parse_cmd(char* str);
diff --git a/libmenu/vf_menu.c b/libmenu/vf_menu.c
index a92bd6e8a5..336261d233 100644
--- a/libmenu/vf_menu.c
+++ b/libmenu/vf_menu.c
@@ -65,7 +65,9 @@ void vf_menu_pause_update(struct vf_instance* vf) {
}
}
-static int cmd_filter(mp_cmd_t* cmd, int paused, struct vf_priv_s * priv) {
+static int cmd_filter(mp_cmd_t* cmd, void *ctx)
+{
+ struct vf_priv_s *priv = ctx;
switch(cmd->id) {
case MP_CMD_MENU : { // Convert txt cmd from the users into libmenu stuff
@@ -240,7 +242,7 @@ static int open_vf(vf_instance_t *vf, char* args){
return 0;
}
st_priv->root->show = menu_startup;
- mp_input_add_cmd_filter((mp_input_cmd_filter)cmd_filter,st_priv);
+ mp_input_add_cmd_filter(cmd_filter,st_priv);
}
vf->config = config;
diff --git a/mplayer.c b/mplayer.c
index 4eec335b99..4f309ff6fb 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -1051,7 +1051,7 @@ static void load_per_file_config (m_config_t* conf, const char *const file)
static int libmpdemux_was_interrupted(struct MPContext *mpctx, int stop_play)
{
mp_cmd_t* cmd;
- if((cmd = mp_input_get_cmd(mpctx->input, 0,0,0)) != NULL) {
+ if((cmd = mp_input_get_cmd(mpctx->input, 0, 0)) != NULL) {
switch(cmd->id) {
case MP_CMD_QUIT:
exit_player_with_rc(mpctx, EXIT_QUIT, (cmd->nargs > 0)? cmd->args[0].v.i : 0);
@@ -2573,10 +2573,10 @@ static void pause_loop(struct MPContext *mpctx)
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_PAUSED\n");
}
- while ( (cmd = mp_input_get_cmd(mpctx->input, 20, 1, 1)) == NULL
+ while ( (cmd = mp_input_get_cmd(mpctx->input, 20, 1)) == NULL
|| cmd->id == MP_CMD_SET_MOUSE_POS || cmd->pausing == 4) {
if (cmd) {
- cmd = mp_input_get_cmd(mpctx->input, 0,1,0);
+ cmd = mp_input_get_cmd(mpctx->input, 0, 0);
run_command(mpctx, cmd);
mp_cmd_free(cmd);
continue;
@@ -3397,7 +3397,7 @@ while (player_idle_mode && !mpctx->filename) {
mp_cmd_t * cmd;
if (mpctx->video_out && mpctx->video_out->config_ok)
vo_control(mpctx->video_out, VOCTRL_PAUSE, NULL);
- while (!(cmd = mp_input_get_cmd(mpctx->input, 0,1,0))) { // wait for command
+ while (!(cmd = mp_input_get_cmd(mpctx->input, 0, 0))) { // wait for command
if (mpctx->video_out)
vo_check_events(mpctx->video_out);
usec_sleep(20000);
@@ -4304,7 +4304,7 @@ if(auto_quality>0){
{
while (1) {
mp_cmd_t* cmd;
- while ((cmd = mp_input_get_cmd(mpctx->input, 0,0,0)) != NULL) {
+ while ((cmd = mp_input_get_cmd(mpctx->input, 0, 0)) != NULL) {
run_command(mpctx, cmd);
mp_cmd_free(cmd);
if (mpctx->stop_play)