This also avoids hardcoding lengths.
Unified · Split
| @@ -903,20 +903,18 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg) · 902 unmodified lines | |||
| 903 | if (!i && !cmd) { | 903 | if (!i && !cmd) { |
| 904 | flags = 0; /* missing relative prefix, build absolute value */ | 904 | flags = 0; /* missing relative prefix, build absolute value */ |
| 905 | } | 905 | } |
| 906 | if (!strncmp(token, "repeat", 6)) { | 906 | if (av_strstart(token, "repeat", &arg)) { |
| 907 | if (cmd == '-') { | 907 | if (cmd == '-') { |
| 908 | flags |= AV_LOG_SKIP_REPEATED; | 908 | flags |= AV_LOG_SKIP_REPEATED; |
| 909 | } else { | 909 | } else { |
| 910 | flags &= ~AV_LOG_SKIP_REPEATED; | 910 | flags &= ~AV_LOG_SKIP_REPEATED; |
| 911 | } | 911 | } |
| 912 | arg = token + 6; | 912 | } else if (av_strstart(token, "level", &arg)) { |
| 913 | } else if (!strncmp(token, "level", 5)) { | ||
| 914 | if (cmd == '-') { | 913 | if (cmd == '-') { |
| 915 | flags &= ~AV_LOG_PRINT_LEVEL; | 914 | flags &= ~AV_LOG_PRINT_LEVEL; |
| 916 | } else { | 915 | } else { |
| 917 | flags |= AV_LOG_PRINT_LEVEL; | 916 | flags |= AV_LOG_PRINT_LEVEL; |
| 918 | } | 917 | } |
| 919 | arg = token + 5; | ||
| 920 | } else { | 918 | } else { |
| 921 | break; | 919 | break; |
| 922 | } | 920 | } |