You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
fftools/cmdutils: Use av_strstart() instead of strncmp()
This also avoids hardcoding lengths. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -903,20 +903,18 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg)
|
|||||||
if (!i && !cmd) {
|
if (!i && !cmd) {
|
||||||
flags = 0; /* missing relative prefix, build absolute value */
|
flags = 0; /* missing relative prefix, build absolute value */
|
||||||
}
|
}
|
||||||
if (!strncmp(token, "repeat", 6)) {
|
if (av_strstart(token, "repeat", &arg)) {
|
||||||
if (cmd == '-') {
|
if (cmd == '-') {
|
||||||
flags |= AV_LOG_SKIP_REPEATED;
|
flags |= AV_LOG_SKIP_REPEATED;
|
||||||
} else {
|
} else {
|
||||||
flags &= ~AV_LOG_SKIP_REPEATED;
|
flags &= ~AV_LOG_SKIP_REPEATED;
|
||||||
}
|
}
|
||||||
arg = token + 6;
|
} else if (av_strstart(token, "level", &arg)) {
|
||||||
} else if (!strncmp(token, "level", 5)) {
|
|
||||||
if (cmd == '-') {
|
if (cmd == '-') {
|
||||||
flags &= ~AV_LOG_PRINT_LEVEL;
|
flags &= ~AV_LOG_PRINT_LEVEL;
|
||||||
} else {
|
} else {
|
||||||
flags |= AV_LOG_PRINT_LEVEL;
|
flags |= AV_LOG_PRINT_LEVEL;
|
||||||
}
|
}
|
||||||
arg = token + 5;
|
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user