Skip to content

Commit

Permalink
tmpút 19. listopadu 2024, 15:33:34 CET
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPulec committed Nov 19, 2024
1 parent 4907784 commit 10757dc
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions src/blackmagic_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#include <stdexcept>
#include <utility>

#include "LinuxCOM.h"
#include "compat/misc.h" // for strncasecmp
#include "compat/net.h" // for htonl, ntohl
#include "compat/strings.h" // for strncasecmp
Expand Down Expand Up @@ -1398,21 +1399,21 @@ print_status_item(IDeckLinkStatus *deckLinkStatus, BMDDeckLinkStatusID prop)

int64_t int_val = 0;
BMD_STR string_val{};
HRESULT rc = s_prop->type == ST_STRING
? deckLinkStatus->GetString(s_prop->prop, &string_val)
: deckLinkStatus->GetInt(s_prop->prop, &int_val);
if (!SUCCEEDED(rc)) {
return;
}

switch (s_prop->type) {
case ST_STRING: {
if (FAILED(
deckLinkStatus->GetString(s_prop->prop, &string_val))) {
break;
}
string str = get_str_from_bmd_api_str(string_val);
release_bmd_api_str(string_val);
MSG(INFO, "%s: %s\n", s_prop->prop_name, str.c_str());
break;
}
case ST_INT: {
if (FAILED(deckLinkStatus->GetInt(s_prop->prop, &int_val))) {
break;
}
char buf[STR_LEN];
snprintf_ch(buf, s_prop->type_data.int_fmt_str, int_val);
MSG(INFO, "%s: %s\n", s_prop->prop_name, buf);
Expand All @@ -1421,9 +1422,6 @@ print_status_item(IDeckLinkStatus *deckLinkStatus, BMDDeckLinkStatusID prop)
case ST_BIT_FIELD: {
char val[STR_LEN];
val[0] = '\0';
if (FAILED(deckLinkStatus->GetInt(s_prop->prop, &int_val))) {
break;
}
for (unsigned j = 0;
s_prop->type_data.map[j].name != nullptr; ++j) {
if ((int_val & s_prop->type_data.map[j].val) == 0) {
Expand All @@ -1443,9 +1441,6 @@ print_status_item(IDeckLinkStatus *deckLinkStatus, BMDDeckLinkStatusID prop)
}
case ST_ENUM: {
const char *val = "unknown";
if (FAILED(deckLinkStatus->GetInt(s_prop->prop, &int_val))) {
break;
}
for (unsigned j = 0;
s_prop->type_data.map[j].name != nullptr; ++j) {
if (s_prop->type_data.map[j].val == int_val) {
Expand Down

0 comments on commit 10757dc

Please sign in to comment.