allow disabling animation playback via -A 0
ref: https://codeberg.org/nsxiv/nsxiv/issues/404
This commit is contained in:
parent
11558c9fcf
commit
55d60319db
|
@ -37,6 +37,9 @@ manager.
|
|||
.BI "\-A, \-\-framerate " FRAMERATE
|
||||
Play animations with a constant frame rate set to
|
||||
.IR FRAMERATE .
|
||||
If
|
||||
.I FRAMERATE
|
||||
is set to 0 then animation playback is disabled.
|
||||
.TP
|
||||
.B "\-a, \-\-animate"
|
||||
Play animations of multi-frame images.
|
||||
|
|
|
@ -171,10 +171,11 @@ void parse_options(int argc, char **argv)
|
|||
exit(EXIT_FAILURE);
|
||||
case 'A':
|
||||
n = strtol(op.optarg, &end, 0);
|
||||
if (*end != '\0' || n <= 0 || n > INT_MAX)
|
||||
if (*end != '\0' || n < 0 || n > INT_MAX)
|
||||
error(EXIT_FAILURE, 0, "Invalid framerate: %s", op.optarg);
|
||||
_options.framerate = n;
|
||||
/* fall through */
|
||||
_options.animate = n > 0;
|
||||
break;
|
||||
case 'a':
|
||||
_options.animate = true;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue