bmd_hresult_to_string: print also error code

This commit is contained in:
Martin Pulec
2022-07-20 13:43:16 +02:00
parent 8e12a29ddf
commit 9388b33f20

View File

@@ -46,6 +46,7 @@
#include "blackmagic_common.h"
#include "DeckLinkAPIVersion.h"
#include <iomanip>
#include <sstream>
#include <unordered_map>
#define MOD_NAME "[DeckLink] "
@@ -69,11 +70,13 @@ static unordered_map<HRESULT, string> bmd_hresult_to_string_map = {
string bmd_hresult_to_string(HRESULT res)
{
ostringstream oss;
auto it = bmd_hresult_to_string_map.find(res);
if (it != bmd_hresult_to_string_map.end()) {
return it->second;
oss << it->second;
}
return {};
oss << " " << "(0x" << hex << setfill('0') << setw(8) << res << ")";
return oss.str();
}
/**