Skip to content

Commit

Permalink
vcomp/cmpto_j2k: accept opt prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPulec committed Sep 12, 2024
1 parent dfda8de commit ff1d9f3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/video_compress/cmpto_j2k.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
#include "module.h"
#include "tv.h"
#include "utils/color_out.h"
#include "utils/macros.h" // for IS_KEY_PREFIX, TOSTRING
#include "utils/misc.h"
#include "utils/parallel_conv.h"
#include "utils/video_frame_pool.h"
Expand Down Expand Up @@ -509,17 +510,17 @@ static struct module * j2k_compress_init(struct module *parent, const char *c_cf
char *save_ptr, *item;
while ((item = strtok_r(tmp, ":", &save_ptr))) {
tmp = NULL;
if (strncasecmp("rate=", item, strlen("rate=")) == 0) {
if (IS_KEY_PREFIX(item, "rate")) {
ASSIGN_CHECK_VAL(s->rate, strchr(item, '=') + 1, 1);
} else if (strncasecmp("quality=", item, strlen("quality=")) == 0) {
} else if (IS_KEY_PREFIX(item, "quality")) {
s->quality = stod(strchr(item, '=') + 1);
} else if (strcasecmp("mct", item) == 0 || strcasecmp("nomct", item) == 0) {
s->mct = strcasecmp("mct", item) == 0 ? 1 : 0;
} else if (strncasecmp("mem_limit=", item, strlen("mem_limit=")) == 0) {
} else if (IS_KEY_PREFIX(item, "mem_limit")) {
ASSIGN_CHECK_VAL(s->mem_limit, strchr(item, '=') + 1, 1);
} else if (strncasecmp("tile_limit=", item, strlen("tile_limit=")) == 0) {
} else if (IS_KEY_PREFIX(item, "tile_limit")) {
ASSIGN_CHECK_VAL(s->tile_limit, strchr(item, '=') + 1, 0);
} else if (strncasecmp("pool_size=", item, strlen("pool_size=")) == 0) {
} else if (IS_KEY_PREFIX(item, "pool_size")) {
ASSIGN_CHECK_VAL(s->max_in_frames, strchr(item, '=') + 1, 1);
} else if (strcasecmp("help", item) == 0) {
usage();
Expand Down

0 comments on commit ff1d9f3

Please sign in to comment.