[description]
The percent argument must be an integer between 0 and 100, inclusively.
[/description]
+
+[subcommand ff]
+ purpose = set playback position relative to the current position
+ non-opts-name = seconds
+ [description]
+ Negative values mean to jump backwards the given amount of seconds.
+ [/description]
}
EXPORT_PLAY_CMD_HANDLER(jmp);
-static int com_ff(struct play_task *pt, int argc, char **argv)
+static int com_ff(struct play_task *pt, struct lls_parse_result *lpr)
{
int32_t seconds;
+ char *errctx;
int ret;
- if (argc != 2)
- return -E_PLAY_SYNTAX;
- ret = para_atoi32(argv[1], &seconds);
+ ret = lls(lls_check_arg_count(lpr, 1, 1, &errctx));
+ if (ret < 0) {
+ if (errctx)
+ PARA_ERROR_LOG("%s\n", errctx);
+ free(errctx);
+ return ret;
+ }
+ ret = para_atoi32(lls_input(0, lpr), &seconds);
if (ret < 0)
return ret;
if (pt->playing && !pt->fn.btrn)
kill_stream(pt);
return 0;
}
+EXPORT_PLAY_CMD_HANDLER(ff);
static int run_command(char *line, struct play_task *pt)
{