Skip to content

Commit 5d3c9f9

Browse files
committed
vcomp/lavc: accept no_intra_refresh
and no_interlaced_dct The original option names are prefixed with disable_ to disable. But if user (mistakenly) uses "no_XY", it actually did the opposite. So rewrite the condition to accept both variants for now. The "no_" prefix may be more natural and it might be switched to in future. Also accept "no_header_inserter" aside the original "header_inserter=no" - the original syntax is inconsistent with the other options above - this could be unified later. + removed duplicite line
1 parent c84422a commit 5d3c9f9

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/video_compress/libavcodec.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,9 @@ parse_fmt(struct state_video_compress_libav *s, char *fmt) noexcept(false)
585585
} else if (strcasecmp(item, "rgb") == 0 || strcasecmp(item, "yuv") == 0) {
586586
s->req_conv_prop.rgb = strcasecmp(item, "rgb") == 0;
587587
} else if (strstr(item, "intra_refresh") != nullptr) {
588-
s->params.periodic_intra = strstr(item, "disable_") == item ? 0 : 1;
588+
s->params.periodic_intra = (int) (strstr(item, "intra_refresh") == item);
589589
} else if (strstr(item, "interlaced_dct") != nullptr) {
590-
s->params.interlaced_dct = strstr(item, "disable_") == item ? 0 : 1;
590+
s->params.interlaced_dct = (int) (strstr(item, "interlaced_dct") == item);
591591
} else if (IS_KEY_PREFIX(item, "threads")) {
592592
char *threads = strchr(item, '=') + 1;
593593
if (strchr(threads, ',')) {
@@ -603,9 +603,8 @@ parse_fmt(struct state_video_compress_libav *s, char *fmt) noexcept(false)
603603
s->requested_gop = atoi(gop);
604604
} else if (strstr(item, "header_inserter") == item) {
605605
s->params.header_inserter_req =
606-
strstr(item, "=no") == nullptr ? 1 : 0;
606+
strstr(item, "no") == nullptr ? 1 : 0;
607607
} else if (strcmp(item, "safe") == 0) {
608-
s->params.periodic_intra = 0;
609608
s->params.periodic_intra = 0;
610609
s->params.interlaced_dct = 0;
611610
s->req_conv_prop.depth = 8;

0 commit comments

Comments
 (0)