Skip to content

Commit

Permalink
DeckLink disp.: use prefix-matching for "synchronized"
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPulec committed Oct 12, 2023
1 parent e288bb4 commit 447f1f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/utils/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ enum {
#define IS_KEY_PREFIX(tok, key) \
(strchr((tok), '=') != 0 && \
strncmp(key, tok, strchr((tok), '=') - (tok)) == 0)
/// similar as above, but also key without a value is accepted (value optional)
#define IS_PREFIX(tok, key) \
(IS_KEY_PREFIX(tok, key) || strncmp(tok, key, strlen(tok)) == 0)

#endif // !defined UTILS_MACROS_H_1982D373_8862_4453_ADFB_33AECC853E48

2 changes: 1 addition & 1 deletion src/video_display/decklink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ static bool settings_init(struct state_decklink *s, const char *fmt,
<< "Deprecated, do not use - "
"see option \"synchroninzed\" instead.\n";
s->low_latency = strcasecmp(ptr, "low-latency") == 0;
} else if (strstr(ptr, "sync") == ptr) {
} else if (IS_PREFIX(ptr, "synchronized")) {
s->low_latency = false;
ptr = strchr(ptr, '=');
if (ptr != nullptr) {
Expand Down

0 comments on commit 447f1f3

Please sign in to comment.