@@ -1106,6 +1106,24 @@ static void display_decklink_probe(struct device_info **available_cards, int *co
1106
1106
decklink_uninitialize (&com_initialized);
1107
1107
}
1108
1108
1109
+ static void
1110
+ set_synchronized (struct state_decklink *s, const char *cfg)
1111
+ {
1112
+ s->low_latency = false ;
1113
+ if (cfg == nullptr ) {
1114
+ return ;
1115
+ }
1116
+ cfg += 1 ;
1117
+ s->delegate .m_min_sched_frames = stoi (cfg);
1118
+ if (strchr (cfg, ' ,' ) != nullptr ) {
1119
+ s->delegate .m_max_sched_frames = stoi (strchr (cfg, ' ,' ) + 1 );
1120
+ } else {
1121
+ s->delegate .m_max_sched_frames =
1122
+ s->delegate .m_min_sched_frames + SCHED_RANGE;
1123
+ }
1124
+ assert (s->delegate .m_max_sched_frames > s->delegate .m_min_sched_frames );
1125
+ }
1126
+
1109
1127
static bool settings_init (struct state_decklink *s, const char *fmt,
1110
1128
string &cardId) {
1111
1129
if (strlen (fmt) == 0 ) {
@@ -1195,19 +1213,7 @@ static bool settings_init(struct state_decklink *s, const char *fmt,
1195
1213
" see option \" synchroninzed\" instead.\n " ;
1196
1214
s->low_latency = strcasecmp (ptr, " low-latency" ) == 0 ;
1197
1215
} else if (IS_PREFIX (ptr, " synchronized" )) {
1198
- s->low_latency = false ;
1199
- ptr = strchr (ptr, ' =' );
1200
- if (ptr != nullptr ) {
1201
- ptr += 1 ;
1202
- s->delegate .m_max_sched_frames =
1203
- SCHED_RANGE +
1204
- (s->delegate .m_min_sched_frames =
1205
- stoi (ptr));
1206
- if (strchr (ptr, ' ,' ) != nullptr ) {
1207
- s->delegate .m_max_sched_frames =
1208
- stoi (strchr (ptr, ' ,' ) + 1 );
1209
- }
1210
- }
1216
+ set_synchronized (s, strchr (ptr, ' =' ));
1211
1217
} else if (strcasecmp (ptr, " quad-square" ) == 0 || strcasecmp (ptr, " no-quad-square" ) == 0 ) {
1212
1218
s->quad_square_division_split .set_flag (strcasecmp (ptr, " quad-square" ) == 0 );
1213
1219
} else if (strncasecmp (ptr, " hdr" , strlen (" hdr" )) == 0 ) {
0 commit comments